I suggest AGAINST first learning C, then moving to C++. Truth is, even though C++ is a superset of C, there are many new things about C++ over C that make it a completely different beast. . |
I strongly disagree. C is a lingua franca of computer science. Everything is compatible with it. Everything has a C API at some level. If you want to write low level stuff, device drivers, operating systems, libraries, etc, knowing C is obligatory - these beasts are usually written in pure C. This can't be said for C++, which is easily replaceable by many other languages.
In fact, there are many things that C programmers swear by that C++ programmers would curse others for doing. There is very much 'unlearning' to do when going from C to C++, if you want to learn C++ then just learn C++ |
I agree, but on the other side, if you learn C first, you would know what to avoid. C++ too often provides you with a feeling of security, which is false, because in fact it is just as easy to break things in C++ as it is in C. Except that if you screw up in C, it is easier to find out and fix, because C programs are usually more straightforward, there are not so many levels of abstraction and indirection, it is much easier to debug when something doesn't work.
Honestly it makes it less fun, it's less interesting, and you feel less powerful (at least I do) when you start programming in 'simple' languages. |
Depends on what is fun. If for someone (like for me) fun is getting things done fast and seeing the effects, "simple" languages are great fun. You can learn much faster instead of wasting two days to find a dangling pointer in the application (which I had many times and it was kinda fun but not such fun like
not having a dangling pointer).
And "simple" doesn't mean "less powerful". I wasn't referring to Basic or PHP. I thought more of beasts like Python[1] which are very easy to get started with, they have simple and logical syntax, yet you can do almost everything with them that can be done with C or C++ with fewer lines and fewer bugs. Also, if you know Python, you may be perceived as a more valuable programer on the market [2] than if you knew only the popular languages like C, C++ and Java.
There is very much 'unlearning' to do when going from C to C++ |
There is much more unlearning if you go from e.g. C++ to Python. Every language has its own preferred style of programming and its own set of quirks. C++ has probably much more quirks than any other language.
[1] In this group of simple, but powerful languages you may also consider: Scala, F#, R, OCaml, Haskell, MATLAB. They are great for writing serious scientific and engineering stuff.
[2]
http://www.paulgraham.com/pypar.html