SharpGreen, on 30 January 2013 - 22:57, said:
You don't need to know anything about C++ to be able to learn C# or Java. If anything C# and Java might help in learning C++ because of the similarities in syntax.
I don't think the question is suggesting that its necessary
to learn C++ first; its merely asking what some potential advantages of learning it before other languages may be. For the serious programmer, its probably best to understand the basics before moving on to something more abstract. Abstraction is great - the bread-and-butter of modern programming - but there is no substitute for understanding how things work underneath. Even with a greater level of abstraction (and therefore ease-of-use) provided by many other modern programming languages, a programmer who understands the cost of each instruction will (hopefully) write more efficient code.
Its somewhat similar to having working knowledge of the architecture of your machine (usually in the context of assembly) when doing embedded device programming. For example, using a int
in C on an 8-bit microcontroller has much higher overhead than using an unsigned char
because an int
is both 16-bits wide (so it can't fit in a single register) and signed (so the sign bit must be explicitly manipulated), translating into more assembly instructions. Most loops could be just as easily be written using an unsigned char
to keep track of the number of iterations as an int
. On modern 64-bit Intel processors this particular restriction has no bearing, but the concept is still the same: know thy architecture.