Thinking in C++

by krishnamoorthyb

This is one book that has completely blown me away! I have been seeing this book for years now but never read it partly because of the layout which i feel is clumsy. This book is not for someone who wants to learn the syntax of C++. There are many other books for that. I would recommetd books by Balaguruswamy, Yashwant Kanitkar or the classic by Stanley B Lippman. Thinking in C++ is reads like a first person narrative from the point of view of the C++ compiler.The author explains each feature of C++ based on how the compiler handles it and how the program’s memory layout in memory is affected because of each feature. Many books spend a lot of effort in documenting the ‘weird’ or exceptional behaviour of C++ – for example, the diffent things that could happen if you use a derived class pointer for a base class pointer. The problem with this approach is that the reader is left with a huge collection of ‘cases’ to remember. The key to understanding the nuances of C++ is to understand how the compiler will lay out the program in memory. Buce Eckel drives home the far reaching implications of gauranteed initialization in C++. My favourite sections of the book are the discussions on initialization and cleanup (chapter 6 in II ed), constants(chapter 8 ) and polymorphism and virtual functions(chapter 15). I really wish i had read this book a few years back…