Friday, September 07, 2007

Linus Torvalds Bullying C++

ROFL! Some guy really managed to piss Linus off yesterday when questioning why Git(a version control system) isn't written in C++ instead of C.
On his nervous reply he took some good time to externalize all of his anger on C++ mechanisms. Here are some highlight moments:
"C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it"

"[...] C++ leads to really really bad design choices. You invariably start using the "nice" library features of the language like STL and Boost and other total and utter crap, that may "help" you program, but causes:

- Infinite amounts of pain when they don't work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it's not even funny)

- Inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app. [...]

I can't see the reason to use object models in version control systems, where we're dealing with low level stuff like byte streams, timestamps and algorithms to retrieve/store those streams.
In this situation you are not modeling something from our world into the computer world (which O.O helps alot), but computer-functional behavior and procedures. For this kind of task C is a fine tool, in the hands of a good programmer of course (with the use good practices and coding carefully to avoid buffer overflows and other memory violation flaws)

That are situations where C++ 's abstractions are helpful , but you still got to be a very skilled architect/programmer to build extensible and maintainable object-oriented software without screwing things up.

Labels: ,