Why C sucks. Part 3473.
Every now and again you hear someone complaining about C++. You will probably also have heard that C sucks. The two statements are of course linked; the following code is valid C, but will never compile.
a.c: #include "a.c"
gcc bails out at the 200th recursion with the error message:
In file included from a.c:1, a.c:1:15: error: #include nested too deeply
I've omitted the two-hundred line long trace back through the other includes.
Update (apparently needed):
This is the best reply to that post ;)
The whole #include C thingy
The whole #include C thingy is one of the most ugly C "features" ;(
One of the things I hate (also used in C++) is:
# cat foo.h
I mean, this is a ugly hack. There're things that could be improved...
I hope you sent this guy from "Spooky's World" a link to this posting? :-D
Only the paranoid
Yes, but only the paranoid would think that the referenced critique of C++ is a swipe against KDE, Qt and various people's manhood, which is how your blog posting appears. I'd guess that a lot of people wouldn't be fully aware of how complex the C++ template system is - there was a well-referenced paper about it and Turing-completeness which did the rounds a while back.
Anyway, C and C++ both suck to varying and endlessly discussable degrees, just like all programming languages. And in a sane world the flame war is suddenly over...
Real power with simple tools
C was conceived in the early 70's for mid-low level programming. Considering the audience it targeted and still targets it is a pretty reasonable language. Real power with simple tools (like in the pre-processor case you cite).
For all the other usages, at the time C was created Algol was already around, then came Pascal, VB and today "managed-code" languages. You have plenty of choices,