News for hackers. Stuff that matters.
Re:Ask HN: C vs C++ by philwelch on Tuesday May 26, 2009 @05:16PM (#627532)
C is a small, beautiful, elegant language that's fine tuned to systems programming and high-performance programming, with a surprising ability to be used on higher levels with enough skill. As a programmer and computer scientist, C will teach you a good abstract model of how a program is executed on the low level (memory management, stack, heap, and so forth), especially if you learn some assembly along with it, and learn how to make C and assembly work together. It is not the best applications language and there are proportionally fewer opportunities to write and read C code than there once was, but it's necessary if you want to be a great programmer.

C++ is a big, clunky, difficult, ugly language. Understanding C++ is an accomplishment, but not because it involves any fundamental learning beyond the peculiarities of that language. As a programmer and computer scientist, C++ will teach you how to design a clunky mess of a programming language. But it is widely used, for good reasons. It's the right blend of performance and abstraction for many applications. It's a good language--maybe the best--for learning certain data structures, just because it combines pointers (data structures are mostly built out of pointers) with encapsulation (which helps reinforce the mental model that, for instance, rotation subroutines are part of what makes an AVL tree an AVL tree). And as an application language, it's very much usable. So it is worthwhile, but probably not a high a priority as C (or, indeed, other languages that can teach you more than simply how to use that particular language).

Re:Ask HN: C vs C++ by sbt on Wednesday May 27, 2009 @05:05AM (#628211)
Calling C small, beautiful and elegant is quite a statement, considering what larger-than-academic projects end up looking like after having been macrofied to the point where only the person who wrote it can make sense of the code.

The bottom line is that they are both rather ugly but practical languages. C++ offers more abstraction means, but is more complex. But for larger projects, I'd rather have that then GLib style hacked up C.

Re:Ask HN: C vs C++ by philwelch on Wednesday May 27, 2009 @10:25AM (#628504)
That's vaguely what I meant when I said that C isn't a great applications language but C++ is a passable one. Different languages are well suited for different tasks, and if you use the wrong language for the task you'll always end up with a mess. So sometimes C++ is more suitable than C. And sometimes some other language entirely is more suitable. But the language design of C--compared to C++--is a masterpiece of clean and simple design.