-
C or C++
Hmm here is the time and time again asked question. Which do you prefer. I'm starting to get into Linux programming and away from the whole Windows scene and I have heard on a lot of forums that C is the way to go in Linux. What's your uptake on that?
-
I really don't bother much with C++, the language as a whole seems too bloated and awkward. C is much cleaner in my opinion.
-
Although all of my programs thus far have been in C, I am learning C++ at the moment and I'm quite impressed. It's a bit of a bloated monstrosity compared to C, but very powerful.
I really do like the OOP approach, so I can see myself going the way of C++ in the future. Since C++ is a superset of C, you really have the best of both worlds.
In my opinion, if you are deciding between C and C++, unless you are planning on kernel hacking or the like, I see no reason to not go with C++.
~arker
-
C for unix system programming.
C++ for larger-scale more conventional software development.
-
POSIX interfaces with C not C++. :D
My opinion C is more than enough and very straight forward.
But C++ is more suitable for large projects.
-
-
C is too conventional. C++ is a whole lot more versatile. C++ classes provide more comprehensive Abstract Data Type management schemes. It enables you to see the connections between aggregated data and the functions for manipulating them. One look at the class container and you can immediately see its overall capability. :)
-
I prefer C, at the very least experimenting with C++ for resume. As the old adage goes "Use what is best suited for the job!":D
-
I dont plan on doing large programs so I guess I'll go with C
-
Overall I prefer C, even for larger projects. I have been in contests with my friends over this very topic and I am able to program the same software in just as little time as he was able to do it with C++. C is very straightforward and just as effective, if not more.
Mind you C++ does have the power behind it, but to me it's way to bloated to be as powerful as it could be. If it was more straight forward then I probably would switch over, but until that happens... which I highly doubt it ever will... then I'm going to stick with C. If companies don't want to hire me because I'm "outdated" or something along those lines, then $$$$ em :)
-
I usually prefer to code in C++ just because I like the object oriented approach. You may prefer to code in procedures instead of objects, in which case C might be the better choice. As far as C++ being bloated, there is a little more overhead in C++ programs, but it's nothing to get your undies in a twist about for the majority of programs. Plus, it's not like you have to code your project strictly with one or the other. The best thing about C/C++ is that they work really well together. A lot of times I write the interface stuff for my programs in C++, and for the real meat-and-potatoes speed demon functions I use C or even assembly if I'm up to it. One huge disadvantage for C++ is that it usually takes about 5 times longer to compile than C code does.
-
I usually (well always) like to program in c, it is more straightforward, and the Linux kernel was written in C. So when I do all my kernel hacking and device driver writing, I need to use C.
-
The language you choose/use should be related to the task at hand. Not which one you 'like'. (like = knows_well) && (like != best_choice)
There is a spectrum of language implemenatation levels.
At the bottom is ASM. Since quite literally anything can be written is ASM you might think it's the best choice. Not necessarily.
It is hard to debug, and hard to read. Productivity is VERY low using ASM.
In the middle are interpreted languages like Python and Perl, and shell script.
Near the other end of the spectrum are scripting languages or database languages like SQL, that sit on top of virtual machines.
(A database engine is a virtual machine, it's where the idea came from) One line of code can execute 100,000 of lines of ASM.
You ought to pick the one that does what you need and gives you the best productivity and is the most maintainable. If you plan to stick with only one (a big mistake longterm), consider C++.
For maintenance coding (like kernel changes) you have to use what the guy before you used. You really should not consider anything else in this case. For all-new development, go for the most productive tool.