Foreword

I l @ ve RuBoard

How do you become an expert? The answer is the same in all the fields I've seen:

  1. Learn the basics.

  2. Study the same material againbut this time, concentrate on the details you didn't realize were important the first time around.

If you pick the right details and master them so thoroughly that you no longer have to think about them, you will be much closer to being an expert. However, until you've become an expert, how do you know which details to pick? You'll learn a lot faster, and enjoy it more, if someone who's already been there picks the right details for you.

For example, I once took a photo workshop given by a fine photographer named Fred Picker. He told us that the only two hard parts of photography were where to put the camera and when to press the button. He then spent most of the workshop teaching us technical details about exposure, processing, and printingdetails we had to absorb completely before we could control our photographs well enough for it even to make sense for us to concentrate on the two "hard" parts.

A particularly entertaining way to learn about the details of C++ programming is to try to answer questions about C++ programs. For example:

  • Do f(a++); and f(a); ++a; have the same effect?

  • Can you use an iterator to change the contents of a set ?

  • Suppose you're using a vector named v that has grown to use an uncomfortable amount of memory. You'd like to clear the vector and return that memory to the system. Will calling v . clear() do the trick?

You have probably guessed that the answers to these seemingly obvious questions must be no otherwise I wouldn't have asked thembut do you know why the answers are no? Are you sure?

This book answers these questions and many other thoughtfully chosen questions about seemingly ordinary programs. There aren't many other books like itexcept, of course, its predecessor, Exceptional C++ . Most C++ books that claim to be "advanced" are either about specialized topicswhich is fine if you want to master those particular topics, but not if you are trying to look more deeply into everyday programsor they use the word "advanced" merely to attract readers.

Once you understand these questions and answers thoroughly, you will no longer have to think so much about the details when you program; you will be free to concentrate on the problems you are really trying to solve.

Andrew Koenig
June 2001

I l @ ve RuBoard


More Exceptional C++
More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions
ISBN: 020170434X
EAN: 2147483647
Year: 2001
Pages: 118
Authors: Herb Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net