12 points · by dnaquin · 18y ago · 32 comments
Driving a manual car, rather than an automatic, teaches you nothing about cars, possibly bar the fact that they have gears. Even that is tenuous: the interaction between the clutch, stick and accelerator is a very abstracted interface to the actual drive mechanism of a car. Manually changing gear is just an extra dexterity skill to learn.
And the opinion is out of date.
The "learning x will make you a better programmer" argument has been made before. However, last time, x was Lisp. This makes sense, because in that case you're sacrificing performance to gain better tools to problem solve. But, in this article, the argument is that learning C++ teaches you about computing basics - memory allocation, storage, retrieval etc. But these things just aren't that relevant anymore. Problem solving tools are generally useful. Technical details are specifically useful, and thus less enriching.
As for the usefulness of learning C or C++, I do think it is useful as a learning exercise. As would assembly programming be. I have met developers who considered themselves "experienced" who are unable to estimate memory requirements for simple data structures. I've had people tell me that pointers are "about one byte" and people who insist that the most compact way to store a boolean value is as an int value.
I can think of thousands of reasons to use C. C is much like learning to drive a stickshift.
C++ is an utterly broken language. It's just an exercise in bad compiler errors, strange and inconsistent language constructs, and strange conventions and boilerplate you need to follow to produce correct code.
* No compile time encapsulation
* Outstandingly complicated grammar
* No way to locate definitions
* No run time encapsulation
* No binary implementation rules
* No reflection
* Very complicated type system
* Very complicated type-based binding rules
* Defective operator overloading
* Defective exceptions
* Duplicate facilities
* No high-level built-in types
* Manual memory management
* Defective metaprogramming facilities
* Unhelpful standard library
* Defective inlining
* Implicitly called & generated functions
</quote> Defective C++ http://yosefk.com/c++fqa/defective.htmlIf we eliminate those, the list reduces down to about eight objective criticisms, of which several are just wrong (No high-level types? Bzzt. The STL is part of the language), and others that are minor variants of the same complaint (that it's not a dynamic language).
(http://amalp.blogspot.com/2007/10/what-is-protected-abstract...)
That's a troll example, designed to be maximally unreadable. The first four words refer to the class, and the last four refer to the function; moreover, one of the words in the former is implied by the latter. So, when you munge it all together, and include more words than necessary, then yeah, it sounds complicated. Thing is, nobody actually does that, unless they're writing articles that bash C++. (In this case, you'd say that you have a protected base class, whose destructor is pure virtual and private. The fact that the base class is declared "virtual" is of no consequence to the destructor.)
There's no doubt that C++ is a complicated language, but if you're going to criticize it, at least reach for something that's a bit more insightful than "you can obfuscate your code!"
It lets you understand, for instance, why accessing the elements of an array in one order is faster than in another order. Or something. I don't know, because I don't know Assembly. :( But I'm pretty sure that if I did I might be a slightly better C/C++/Fortran programmer than I am.
Not to be, you know, pedantic about it or anything. I liked your response. =)
apparently it's a weeder course
I grant you the simile is imperfect, but I'm a firm believer that learning C/C++ can make you better.
Although at the same time, I find that C++ can be quite useful if you are disciplined in what parts of it you use.
I think it's great that you get some decent data structures (Standard Template Library) out of the box.
You can search for "malloc lab" and find tons of copies of the assignment (with only the instructor names and course numbers changed), but here's one:
http://www.cs.cmu.edu/afs/cs/academic/class/15213-f02/L6/mal...