Huh?

Why the Programming Language C is Obsolete. C obsolete? Really? Someone forgot to tell Linus. Bjarne Stroustrup is clearly a smart guy and by all accounts a nice guy so I hate to call his baby ugly but Damn! that's one ugly baby.

At one point in my career I tried really hard to like C++ but I could never convince myself that it was anything other than a disaster. Perhaps I'm not smart enough to learn C++ adequately or to see its manifest superiority because it still looks ugly to me. One advantage of writing in C rather than a Lisp-like language or Python or Ruby is that you can get almost down to the metal. Lots of fine grained control but, of course, you pay for that by having to worry about memory management and other annoying details. Another advantage, for me, is that I have an excellent mental model of what code will be generated for a given C statement and can use that model to pick between alternative C constructs for a particular task.

C++ adds complexity and destroys my mental model but still requires me to worry about low level details like memory management. How is this an improvement? Object Oriented Programming I hear you say. Except that it's not clear that the benefits are worth the costs as far as C++ goes. I know, I know, Apostasy! Still, I can't help but agree with Linus on this.

This entry was posted in General. Bookmark the permalink.

One Response to Huh?

  1. I would say the main benefits of C++ are:

    1. RAII for memory mangagement.
    2. A much larger standard library with things like dynamic arrays, hash tables, and algorithms.
    3. std::string

    I could come up with more... I think C has it's place, but C++ can be very good if you are willing to invest the time to learn how all the pieces fit together. In particular, learning how the STL collections, iterators, and algorithms works can help a lot.

    That said, I only use it for performance intensive stuff... Everything I use Python or Javascript for.

Comments are closed.