Skip to content
J-Donald Tournier edited this page Sep 25, 2024 · 3 revisions

List of ideas for the new course

Main idea is to teach on the terminal only, with direct interaction with the compiler. No IDE and all the associated software installation / cross-platform problems, etc.

Concepts to be covered:

  • use of the terminal
  • file paths, current working directory, command-line arguments
  • iostream / fstream
  • std::string
  • std::array
  • std::vector
  • std::format
  • std::ranges
  • range-based for-loops
  • std::find and variants
  • std::sort
  • lambda functions
  • classes & structs
  • headers & code files, and how to spread code around them
  • templates
  • namespaces
  • const, const refs, etc.
  • inline keyword
  • inheritance, aggregation, composition
  • use of virtual inheritance via pass-by-reference

Up for debate:

  • operator overloading
  • friend functions
  • static members
  • debugging via GDB

Concepts deliberately not covered:

  • C-style arrays
  • pointers
  • smart pointers
  • aggregation through pointers
  • inheritance through pointers

Slides

I propose to use remark to prepare the slides. It allows us to write pure markdown, and provide C++ syntax highlighting out of the box. See example slides here, produced from his simple markdown file.

Environment

Use MSYS2 with g++ and the micro text editor. See the related software page for full details.

Allow (maybe even encourage?) students to use whatever editor they want, and maybe even experiment with IDEs if they so wish.

Start by compiling on command-line, then maybe use Donald's simple_build bash script to automate - no need to faff about with Makefiles, CMake or anything else - it should Just Work™.

For projects that would benefit from graphical output, consider using Donald's terminal_graphics header-only project. This allows plotting simple graphs and displaying 2D arrays on a sixel-capable terminal (including minTTY, installed as part of MSYS2).

Sources of inspiration:

Using GDB on the command line:

commands to cover (if we decide to):

  • start [args ...]
  • list [l]
  • info locals [i loc]
  • print [p ]
  • watch
  • delete N
  • backtrace [bt]
  • next [n]
  • continue [c]
  • advance N [adv N]
  • step [s]
  • finish [f]
  • quit [q]
  • break N [b N]