Skip to content

Since these students already understand the "how" of programming (logic, loops, and collections) through Python, this curriculum focuses on the "why"—specifically how C++ handles memory, types, and the compilation process.

The goal is to transition them from Python's abstraction to C++'s precision.


C++ for Pythonistas: Curriculum Outline

  1. The Compiled World
  • High-level vs. Low-level: What happened to the Interpreter?
  • The Build Cycle: Source -> Compiler -> Object -> Linker.
  • Boilerplate Breakdown: Header files and int main().
  1. Strict Typing and Memory
  • Static vs. Dynamic Typing.
  • Integral Types: int, long, short, and the unsigned modifier.
  • Floating Point Precision: float vs double.
  • Character encoding: char vs Python's string-index.
  1. Console I/O and Streams
  • The iostream library.
  • Standard Output (cout) and Insertion Operators (<<).
  • Standard Input (cin) and the Buffer.
  • Formatting output with iomanip.
  1. Control Flow: The Syntax Shift
  • Boolean logic differences (no more and/or, welcome &&/||).
  • Braces {} vs. Indentation.
  • The switch statement: A new tool for branching.
  1. Memory Addresses and References
  • The & operator: Finding where data lives.
  • Pass-by-value vs. Pass-by-reference.
  • Why C++ doesn't "copy" everything by default.
  1. Fixed-Size Arrays and Vectors
  • Static Arrays: Memory allocation at compile time.
  • std::vector: The closest relative to the Python List.
  • Common pitfalls: Out-of-bounds errors and "Segfaults."
  1. Strings as Objects and Arrays
  • C-style strings (null terminators) vs. std::string.
  • String manipulation and the string library.
  1. Functional Power
  • Function Prototypes (Forward Declaration).
  • Return types and the void keyword.
  • Overloading: Multiple functions with the same name.
  1. Structs and Data Modeling
  • Grouping related data (Intro to OOP).
  • Transitioning from Python Dictionaries to C++ Structs.
  1. The Concept of Pointers
  • The * operator: Holding addresses.
  • Null pointers (nullptr).
  • Introduction to the Heap vs. the Stack.
  1. Object-Oriented Programming (OOP)
  • Classes and Objects.
  • Access Specifiers: public vs private.
  • Constructors and Destructors (Managing cleanup).

Why this structure works:

  • Front-loading Memory: Python hides memory management. By introducing references and types early, students understand why C++ feels "stricter."
  • Vector focus: Since they know Python lists, teaching std::vector early gives them a sense of productivity before they dive into the "scarier" world of raw pointers.
  • Header Files: This is usually the biggest hurdle for Python students. Dedicating the first chapter to the build process prevents "magic code" syndrome.

Would you like me to expand on the specific exercises or "Python vs. C++" comparison charts for any of these chapters?