torvalds trashes c++ (i do not agree, by the way)by easylangs (Login easylangs)
one of the most important c programs ever written, is arguably the linux kernel. the author for who its named, as it happens, has a very low opinion of c++ though. i do not share any of these opinions--
my only "gripe" with c++ is that it isnt easier to use... and i dont think its the job of c++ to be easy to use. so i think it would be more accurate to say i have no gripe with c++ at all. still, i found these interesting-- especially when compared to some of the things dijkstra said about (very old versions of) basic: like that it leads to bad design choices and is only used by substandard programmers.
"C++ compilers are not trustworthy. They were even worse in
1992, but some fundamental facts haven't changed:
- the whole C++ exception handling thing is fundamentally broken. It's
_especially_ broken for kernels."
" - you can write object-oriented code (useful for filesystems etc) in C,
_without_ the crap that is C++."
i think its funny that he feels this way, because people talk about languages they dont like in strong words like these all the time. i also think c++ has got to be one of the highest-quality and most important languages of all time, while c is also one of the most important-- and vital to a lot of things i use, where c++ is not an adequate replacement.
if i had to use either c or c++ on a regular basis, i would almost certainly choose c++. im not a kernel author, im not writing drivers, and c++ seems like a considerably less tedious choice overall.
i also suspect that c++ is a better choice for implementing basic, compared to c. you can use either one, and what comes out of the effort to implement basic in c++ will (in the hands of anyone but very-above-average c coders) probably be more reliable than a similar implementation in c, perhaps with the occasional exception.
none of which is a diss of c, either. both have their strengths and applications where one is likely better suited than the other.
Return to Index