To read all comments associated with this story, please click here.
no no, c is not bad. macro's, global variables, pointers, no range checking (for arrays), bufferoverflows, the stl error messages and that kind of stuff are bad.
c(++) has a nice syntax. java and c# don't have the problems mentioned above, and that's why they are often used.
Macros are bad. Global variables are necessary. Pointers are useful (although not always necessary). Range checking is good in all but the most performance-critical code. I'll add that manual memory management is usually (but not always) unnecessary.
C++ does NOT have nice syntax and it's semantics are even worse. Java is nice, C# is a little nicer, but neither compiles very well to native code.
D ftw!
"Just good enough to be used, just bad enough to inspire countless revisions, and even with vastly superior successors it'll probably never die just due to the inertia of having been there first."
That sounds exactly like a desciption of the average programmer who is incapable of programming C or it's children because they require nappies in the runtime environment to keep making up for the buggy, diseased code they end up slapping together.
Vastly superior successors? Do you have ANY experience with real development?
There's a time and a place for C and C++, just like there's a time and a place for Java and C#, just like there's a time and a place for machine code and assembly programming.
There are a number of tasks that I wouldn't want to do in any other language than C. It is simply the best tool for some jobs.
I'd really like to hear about some of these vastly superior languages, so I can write my kernel drivers in them.
I'd really like to hear about some of these vastly superior languages, so I can write cellphone applications in them.
Please, share with me what these wonderful panacea languages are, so that I can write my toolkit libraries in them, and let my customers call them from whatever language they use.
When people talk of vastly superior languages, they are really talking about a shift in language application. People can do much more much quicker in Java/C#/Perl/Python/Ruby then in C/C++ (speaking from experience as a former Java/C/C++ programmer). Thus the application space for C/C++ shrinks, people move to more modern languages, and they begin to frame their discussions wrt those languages.
Take this link, educate yourself, then re-read your post, sir:
http://gcc.gnu.org/
You realize of course that the reason your operating system isn't dog slow is because they *are* using a very close to asm-like language, aka C and some use C++.
<rant>
Just because C/C++ don't hold your hand doesn't mean they don't have a use. They are system level languages, and I have to think of the fantastic duo that created it and Unix everytime I have to write embedded software. ASM is a pain in the ass, C is like a better ASM without the hassle of remembering all the machine specifics, and C++ is like a better C, adding in some great features that save time if you know how to use them. Thinking about it in those terms, it makes perfect sense why they exist and why they are so popular. I have no doubt more than half the programmers out there despise these languages because they never understood how a computer really worked in the first place, or even if they did, despised the effort required to write proper C/C++ programs. Hell C++ makes it even easier if you follow a few simple paradigms and common practices. Of course your not going to learn it over night in some C++ 24hrs book which teaches a glorified C as C++.
</rant>
RANT
BEGIN
Most software isn't system software and doesn't need all that low-level stuff. Yet C/C++ are the default languages of programming. Office software, web browsers, games etc. are all written in C++. Why? Stability and cost of development are much more important than perfomance, even in games. C++ is used because it's widely known, which thus reduces the cost of development, not because it's an inherently good language for software development. It allows you to make mistakes most people have absolutely no need to make and the result is not that the only programmer is a good programmer, but rather that there are an awful lot of very bad programs in the wild. Crashes and memory leaks are as much the fault of the choice of language as they are the fault of the programmer. There are plenty of other languages that are just as fast for most things. C/C++ do indeed have their place, it's just that that place isn't everywhere.
END RANT.






Member since:
2007-02-22
C and its children are the Esperanto of programming languages.
Just good enough to be used, just bad enough to inspire countless revisions, and even with vastly superior successors it'll probably never die just due to the inertia of having been there first.
Does anyone have a link to a transcript?