[26] Learning OO/C++
(Part of C++ FAQ Lite, Copyright © 1991-2001, Marshall Cline, cline@parashift.com)


FAQs in section [26]:


[26.1] What is mentoring?

It's the most important tool in learning OO.

Object-oriented thinking is caught, not just taught. Get cozy with someone who really knows what they're talking about, and try to get inside their head and watch them solve problems. Listen. Learn by emulating.

If you're working for a company, get them to bring someone in who can act as a mentor and guide. We've seen gobs and gobs of money wasted by companies who "saved money" by simply buying their employees a book ("Here's a book; read it over the weekend; on Monday you'll be an OO developer").

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[26.2] Should I learn C before I learn OO/C++?

Don't bother.

If your ultimate goal is to learn OO/C++ and you don't already know C, reading books or taking courses in C will not only waste your time, but it will teach you a bunch of things that you'll explicitly have to un-learn when you finally get back on track and learn OO/C++ (e.g., malloc(), printf(), unnecessary use of switch statements, error-code exception handling, unnecessary use of #define macros, etc.).

If you want to learn OO/C++, learn OO/C++. Taking time out to learn C will waste your time and confuse you.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[26.3] Should I learn Smalltalk before I learn OO/C++?

Don't bother.

If your ultimate goal is to learn OO/C++ and you don't already know Smalltalk, reading books or taking courses in Smalltalk will not only waste your time, but it will teach you a bunch of things that you'll explicitly have to un-learn when you finally get back on track and learn OO/C++ (e.g., dynamic typing, non-subtyping inheritance, error-code exception handling, etc.).

Knowing a "pure" OO language doesn't make the transition to OO/C++ any easier. This is not a theory; we have trained and mentored literally thousands of software professionals in OO. In fact, Smalltalk experience can make it harder for some people: they need to unlearn some rather deep notions about typing and inheritance in addition to needing to learn new syntax and idioms. This unlearning process is especially painful and slow for those who cling to Smalltalk with religious zeal ("C++ is not like Smalltalk, therefore C++ is evil").

If you want to learn OO/C++, learn OO/C++. Taking time out to learn Smalltalk will waste your time and confuse you.

Note: I sit on both the ANSI C++ (X3J16) and ANSI Smalltalk (X3J20) standardization committees. I am not a language bigot. I'm not saying C++ is better or worse than Smalltalk; I'm simply saying that they are different.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[26.4] Should I buy one book, or several? UPDATED!

[Recently rewrote; added the "programming by example" category (in 4/01) and wordsmithing thanks to Stan Brown (in 8/01). Click here to go to the next FAQ in the "chain" of recent changes.]

At least three.

There are three categories of insight and knowledge in OO programming using C++. You should get a great book from each category, not an okay book that tries to do an okay job at everything. The three OO/C++ programming categories are:

Legality guides describe all language features with roughly the same level of emphasis; morality guides focus on those language features that you will use most often in typical programming tasks. Legality guides tell you how to get a given feature past the compiler; morality guides tell you whether or not to use that feature in the first place.

Meta comments:

There is a fourth category you should consider in addition to the above three: OO Design books. These are books that focus on how to think and design with objects.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[26.5] What are some best-of-breed C++ morality guides?

Here's my personal (subjective and selective) short-list of must-read C++ morality guides, alphabetically by author:

Similarities: All three books are extensively illustrated with code examples. All three are excellent, insightful, useful, gold plated books. All three have excellent sales records.

Differences: Cline/Lomow/Girou's examples are complete, working programs rather than code fragments or standalone classes. Meyers contains numerous line-drawings that illustrate the points.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[26.6] What are some best-of-breed C++ legality guides?

Here's my personal (subjective and selective) short-list of must-read C++ legality guides, alphabetically by author:

Similarities: Both books are excellent overviews of almost every language feature. I reviewed them for back-to-back issues of C++ Report, and I said that they are both top notch, gold plated, excellent books. Both have excellent sales records.

Differences: If you don't know C, Lippman's book is better for you. If you know C and you want to cover a lot of ground quickly, Stroustrup's book is better for you.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[26.7] What are some best-of-breed C++ programming-by-example guides? NEW!

[Recently created (in 4/01). Click here to go to the next FAQ in the "chain" of recent changes.]

Here's my personal (subjective and selective) short-list of must-read C++ programming-by-example guides:

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[26.8] Are there other OO books that are relevant to OO/C++?

Yes! Tons!

The morality, legality, and by-example categories listed above were for OO programming. The areas of OO analysis and OO design are also relevant, and have their own best-of-breed books.

There are tons and tons of good books in these other areas. The seminal book on OO design patterns is (in my personal, subjective and selective, opinion) a must-read book: Gamma et al., Design Patterns, 395 pgs, Addison-Wesley, 1995, ISBN 0-201-63361-2. Describes "patterns" that commonly show up in good OO designs. You must read this book if you intend to do OO design work.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


E-Mail E-mail the author
C++ FAQ LiteTable of contentsSubject indexAbout the author©Download your own copy ]
Revised Aug 15, 2001