Thinking in C++ — Vol. 1
Author: Bruce Eckel
Edition: 2nd Edition
Format: Self-study reference book (not a formal university course)
Scope ingested: Preface + Chapter 1 (Introduction to Objects) + Chapter 2 (Making & Using Objects) — book pp. 1–120
About the Book
Thinking in C++ teaches C++ and OOP to experienced programmers — it assumes you can already program (in C or another language) but need to learn how to think in objects. The goal is not just syntax but a mental shift: designing in the problem space rather than the solution space.
Key Concepts
OOPFoundations — Core OOP principles: abstraction, Alan Kay’s 5 characteristics, encapsulation, composition, inheritance, polymorphism, stack vs. heap, exceptions
CppBuildProcess — The full build pipeline: preprocessor → parser → code generator → linker; static type checking; separate compilation; libraries
CppProgramStructure — Declarations vs. definitions (ODR, extern); function syntax; header files; namespaces; main(); comments
CppIOStreams — cout, cin, endl, <<, >>; file I/O (ifstream, ofstream, getline); manipulators; character arrays
CppStringAndVector — std::string (dynamic, operator overloading); std::vector
Chapters Ingested
| Chapter | Topic | Summary | Status |
|---|---|---|---|
| Preface | Why OOP, why C++ | TIC-Ch1-IntroToObjects | ingested (with Ch.1) |
| 1 | Introduction to Objects | TIC-Ch1-IntroToObjects | ingested |
| 2 | Making & Using Objects | TIC-Ch2-MakingAndUsingObjects | ingested |
| 3 | The C in C++ | — | not yet |
| 4+ | … | — | not yet |
Design Methodology (Ch. 1)
Eckel’s 6-phase OOP methodology:
- Phase 0: Make a plan (write a mission statement)
- Phase 1: What are we making? (use cases, CRC cards)
- Phase 2: How will we build it? (class design, UML)
- Phase 3: Build the core (essential structure)
- Phase 4: Iterate the use cases (1–3 week cycles)
- Phase 5: Evolution (“maintenance”)
Also covers Extreme Programming (XP): write tests first, pair programming.
Why C++ Succeeds (Ch. 1)
- Better C: static type checking, references, function overloading, namespaces
- Efficiency: within ~10% of C speed
- Expressibility: problem-space modeling
- Library leverage: reuse well-designed class libraries
- Templates: source-code reuse (“a class of anything”)
- Exception handling: guaranteed error propagation
- Gradual migration: existing C code doesn’t need rewriting