Quote:Original post by Stoo
Take Java.
Its syntax is a nice introduction for C++, looking similar on the surface.
No memory management needed, it is all handled for you by that Garbage collector.
I believe Java is a good language to learn about object-oriented style programming, though the way generics and some things like that have been implemented is a little bit questionable.
Though for a complete beginner, I think OOP is a little too advanced to learn straight off without some sort of formal guidance by a college/school. I remember I found it quite alien and difficult to grasp the first time I was introduced to classes and the idea of static variables, objects and dynamic binding.
I think it would be better to start off with a simple procedural language first and then move on to something a little more complicated like Java once you get the basics down. It doesn't have to be for 2 years like mentioned above, just until you are confident with the basic ideas, and then moving onto another language like C or Java would be good and much much easier. I think C would be a little bit better because while it has memory management (which is again good to know), the idea of pointers and structs is a good thing to know when thinking about objects and accessing their members. Also, C is pretty much still a procedural language so it's not a huge leap from other simpler languages.
After all, C++ supports a wide variety of programming paradigms, from monolithic spaghetti code, to procedural structured with functions, to functional, to OOP etc. I think that if you get into the habit of using OOP too early on, you will end up overusing inheritence and other powerful tools and will be tempted to overcomplicate your design. Since Java is purely OOP, it probably isn't ideal to learn straight off.
Another advantage of C, is that it basically introduces you to the syntax of alot of other similar languages including Java, perl, C++ etc. And once you know C, you can be fully appreciative of the advances in memory management and the garbage collector of other languages like Java. Not to mention that millions of lines of code have already been written in C, which means theres ALOT of tutorials and documentation out there to help you learn more.
Of course, this is all still my personal opinion. Really any language is fine to begin with, just some languages will be harder than others for a beginner. Ultimately, you will learn most of the relevant ones anyway, and once you know one, its pretty much a matter of syntax to learn all the others.