I\'ve been a longtime PHP web developer. But now I\'ve reached the limits and we
ID: 654680 • Letter: I
Question
I've been a longtime PHP web developer. But now I've reached the limits and web doesn't fascinate me anymore. I am interested in learning cross-platform development. I have learned Java for almost a year and know much of its OOP concepts but I would like to develop high-performance cross-platform programs and I find Java to be somewhat slower unless you have a beast hardware.
Searching for programming books on C and C++, I have only found that they only covers the basics which are same for every language. Datatypes, Loops, Conditionals, Operators etc. But the languages are no more this minimal. C++ provides STL and I've yet to find a book which shows you how to develop real-world programs using these standard features.
I know PHP very well, I have known ins and outs of MVC and Singleton Design Patterns, but then I stumbled upon Qt Framework and some of the apps it has powered: Skype, VLC, KDE and they all are rock-solid. I've NEITHER faced any bugs or crashing issues with these applications on Windows NOR on Linux.
My request How should I approach learning Qt? The biggest difference I'm encountering is C++'s static typing which is very different than the dynamically-typed languages (PHP, Python etc.) I have already worked with.
Explanation / Answer
You should learn both. As Qt is implemented in C++, you need to learn C++ to be able to use it effectively and correctly anyways. So that's where to start. A good understanding of the language itself and the standard library will give you a solid foundation to understand Qt, and how to use it as well.
As for a good book to learn C++, I like Koenig and Moo's Accelerated C++. There's probably books that combine C++ with Qt for learning too, but I don't know them.
Edit: Some additional points: C++ is a large and complex language. In addition to the static typing, you also have to deal with memory management and object lifetime, etc. in ways you will not be used to from dynamic languages. Method resolution and overloading is another area which may be quite different from what you already know. The language makes all the tools you need to handle these issues efficiently if you know how to use them.
My suggestion is to try to learn the language from afresh, not comparing it to any of the dynamic languages you may already know. Learn the basics and understand the established patterns (RAII, The Rule of Three, etc) well! This will help you many times over, both in designing good code, in resolving cryptic compiler error messages, and tracking down bugs in the code.