ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Which language is used most today for programming - C or C++? Can one be a good programmer learning C++ and not C (I know that C is closely related to C++, but there are some differences)?
For helping out on programming for Linux and Unix OS's and comprehensive and large programming projects (i.e. typesetting engines and front-ends, text editors, etc.), which one is better C or C++?
I think it would depend on what you plan on doing. If you are going to do a lot of kernel development, go with C. If you are going to do a lot of gui stuff, from what I've noticed (I use KDE, so a lot of qt) it's mostly C++. Personally, I would say learn as many as possible, don't limit yourself to just one language.
I write most of my gui work in gtk, so I'd say mostly C for guis. But what it ultimately breaks down to is this: if you want to work on mostly free software, learn C first. If you want to make a career out of it, learn c++ first. The only big c++ free software projects you really see are Qt and Mozilla, both of which began life as closed commercial products. But eventually, it will benefit you to learn both, and others.
C and C++ are different languages, whilst their is much familiarity with the syntax between the two C++ is more than just C with extra functionality. C++ requires a different approach to software development. Put crudely the reason this was felt important is that C is great for small projects, whilst more structured language elements were required for larger projects. Of course it is possible to have successful large projects written in C, the features of C++ are designed with large projects in mind. So when talking about large projects, are C++ projects more successful that C projects? I don't have any data on that but the statistics of successful projects is fairly grim reading, but this failure is more to do with the management of projects, feature creep, unrealistic time frames, and / or poor quality procedures.
So back to your question, which is better C or C++?
There is no better, they are different, it's like asking which is better apples or oranges? They are both good and they both perform a function very well. So learn both, but more importantly learn to program like a good C programmer, and also learn to program like a good C++ programmer.
I am in a C++ Programming class this semester at the University. I have done some other programming in the past (Pascal in High School and some Basic programming in a couple courses at the University several years back). This is the first intensive programming course I have taken so far.
No matter the case, one of my primary goals is to learn how to program well, with well structured programs that function as well as they can. Any documentation you can link to would be appreciated.
They're both tons of fun. I'm a C programmer at heart, but I love programming in C++ when I get the chance. I do both quite often, along with a host of other languages. As for which is best to learn? Since C++ is object oriented, it is better supported by current modelling tools and techniques, so most large commercial projects use C++. This support generally means C++ is cheaper, easier to implement with, and more maintainable. This is not a "C can't be maintained" thing, but rather "it is generally easier and more cost effective to maintain C++ code." If you are really only coding for a job, then learn C++, otherwise you'll probably end up learning both.
I dont see how everyone thinks c and c++ are so different...
true, a real c++ program looks a lot different to a c one, but when your learning a language you usially dont get into the object oriented phases until you have learnt most other aspects.
I dont know how your being tought, but that was defenitaly the case for me
I learned c++ first, i later bought a c book just to look over and i had no trouble picking it up. If you ask me, once you know c++ you know c, but it might be wise to buy a book (i highly reccomend "The c programming language" publisher: prentice hall) just to become familiar with the standards when NOT using o.o.p.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.