Macha

Learning C++

August 26, 2009 | categories: Programming

As usual, I'm falling behind on blogging. One of the reasons for that is I am currently learning C++.

A while back, I had a brief exploration into C++, and learnt the basic syntax, then moved on and didn't do anything related to it for 6 months. The majority of my programming has been done in Javascript, Java or PHP, though I have looked into other languages. Since Java and C++ are quite similar in some respects, and I did learn the basics beforehand, I'm not starting from scratch completely, though in some ways it would be beneficial if I was. An example is this:

int array[somevar]

Perfectly legal, and quite common in Java. In C++, this shouldn't work. Except it did for me, because it is a g++ extension. Someone with no programming experience would not have tried this. This is something I hadn't expected. I had expected C++ to be more like Java, and PHP where there was one standard of the language (and the only differences were between new and old), but it seems, like Javascript, there are a few variations per implementation.

Another thing that surprised me was the small size of the standard library. Compared to the Java API, and the .NET Framework, the C++ Standard Library is tiny. No GUI code, no threads, no networking functions.

The final hurdle I encountered is there is so little information about C++ online. On the one hand, I should of expected this, as the origins of C++ predate the internet, and it's not a web language, but it means I have a lot of difficulty finding material. My local book store has only 3 shelves of computer books, with the programming catalogue nearly entirely taken up by C#, Java and PHP. As well as that, the books I found in the library are quite old and mostly aimed at people coming from C or Pascal, or a variety of other older languages.

I'm wondering what other people's experience of learning C++ is.