How to learn C++ (and Windows development)
Every few months I get asked for book recommendations for learning the C++ programming language and then how to get started with Windows programming with C++. I don’t buy into the “C++ in 10 days” school of learning but rather advice readers to read books that will provide them with a good foundation.
Be warned: this is not for the faint of heart. If you’re looking for a gentle introduction to Windows programming then you should learn C#, but if you’re looking to “go deep” with Windows then you need to follow the C++ track, even if you eventually migrate to C# for some of your application development needs.
Here is what I recommend.
Start by working through The C++ Programming Language (3rd edition or special edition) by Bjarne Stroustrup, the creator of C++. This book will teach you what is generally referred to as Standard C++ and should apply to any C++ compiler on any platform.
The next step is to learn the fundamental building blocks of Windows applications. I’m talking about processes, threads, memory management and dynamic link libraries. Work through Programming Applications for Windows (4th edition; previously called Advanced Windows) by Jeffrey Richter. Unfortunately it appears to be out of print. There is always the Windows SDK to fall back on.
To build rich user interfaces I suggest you pick up a copy of Programming Windows (5th edition) by Charles Petzold. I honestly haven’t spent that much time with this book as I prefer to dig into the Windows SDK directly but this book is very well regarded and covers the essentials of windows and messages, basic graphics programming, keyboard and mouse input, etc. I also have to mention Programming Windows with MFC (2nd edition) by Jeff Prosise as it is a fantastic book and really helped me when I first started programming (with the 1st edition). I cannot however recommend MFC for those that are starting out as I consider it a legacy library. ATL combined with WTL provide a much more compelling solution for C++ programmers targeting the Windows operating system.
The .NET Framework may completely replace COM in the long run but COM is still very much alive today and must be understood if you want to take advantage of all corners of the Windows SDK. Essential COM by Don Box is all you need. This book is every bit as relevant today as when it was first released in the NT 4 era. To get up to speed on subsequent advances to COM you simply need to read the articles Don published in MSJ and MSDN Magazine since then.
The final book you need to read before we turn our attention to managed code is Programming Windows Security by Keith Brown. This book will help you to understand what principals and authorities are, how principals are authenticated, how access is enforced (authorization) and how authentication is achieved on a Windows network. This is essential information for any Windows developer.
The .NET Framework is the next (last?) major runtime you need to internalize. CLR via C# (2nd edition) by Jeffrey Richter is all you need here. There are some other good .NET books but this one will not only introduce you to C# but give you a good understanding of the Common Language Runtime and the .NET Framework.
In some ways the .NET Framework represents the future of development on Windows and C++ is ideally suited to get you there. I wrote one of the first articles on C++/CLI before the compiler even knew how to deal with it but if you really want to dig into C++/CLI and you should pick up a copy of C++/CLI: The Visual C++ Language for .NET by Gordon Hogenson.
There are many more books that I would recommend but the ones I mentioned thus far should give you a great start. Hope that helps!
© 2007 Kenny Kerr