Skip to content

Course contents (draft)

J-Donald Tournier edited this page Oct 22, 2024 · 13 revisions

Week 1

Session 1: Introduction to the command-line, first steps

  • the command-line
  • navigating the filesystem
  • invoking the compiler
  • using an editor: micro (or notepad++)
  • writing our first hello_world.cpp
  • plain old data (POD) types: bool, int, float, double
  • the std::string class
  • command-line arguments
  • the std::vector class
  • range-based for loop
  • the auto keyword

Exercises??

Session 2: formalise control flow, terminal IO & functions

  • terminal I/O
  • the while loop
  • functions
  • introducing first project: DNA shotgun sequencing

Week 2

Session 1: file IO

  • file input/output
  • introduce concept of RAII?
  • handling file paths
  • implement loading function for project

Session 2: split project files

  • separate code into header and cpp files
  • how to compile and link at the command-line
  • explain C preprocessor in more detail
  • automated build systems (and introduce our custom build script)
  • introduce namespaces?

Week 3

Session 1:

Session 2:


Week 4

Session 1:

Session 2:


Week 5

Session 1:

Session 2:


Week 6

Session 1:

Session 2:


Week 7

Session 1:

Session 2:


Week 8

Session 1:

Session 2:


Week 9

Session 1:

Session 2:


Week 10

Session 1:

Session 2:


Unsorted topics to be (or not) covered:

  • difference between compiled and interpreted languages

  • the preprocessor and directives

  • the #include statement

  • the compile & link process

  • C vs. C++

  • dynamic vs. static type checking

  • namespaces - the std:: namespace

  • namespaces - how to define & use your own

  • single-line comments

  • multi-line comments and why they're usually best avoided

  • editing a file

  • compiling a program

  • using the command-line

  • file path concepts (absolute, relative)

  • shortcuts for special folders (., .. , ~)

  • running a command - even when not in the PATH, or in the current folder

  • debugging a program - using a debugger?

  • anatomy of a command - arguments & options

  • statements

  • compound statements

  • std::vector

  • std::string

  • difference between std::vector::operator[] and std::vector::at() in terms of bounds checking

  • checking for errors

  • throwing exceptions

  • handling exceptions

  • standard arithmetic operators

  • comparison operators

  • logical operators

  • operator precedence

  • standard data types

  • expressions with mixed types, implicit type casting, integer promotion, ...

  • const for variables

  • const for pass-by-reference

  • const for member methods

  • the <cmath> header and associated functions

  • list initialisers

  • control flow

  • if statement

  • nested if statements

  • regular for loop

  • range-based for loop

  • while loop

  • do-while loop

  • switch statement

  • jump statements: break and continue

  • conditional (ternary) operator (?:)

  • references

  • using functions

  • defining functions

  • pass by value vs. pass by reference

  • returning values from functions

  • default arguments for functions

  • function overloading

  • variable scope: global, block, function

  • spreading projects over multiple files

  • multiple files: implications for compiling & linking

  • function recursion

  • the program stack

  • inline functions

  • struct

  • enum

  • file I/O

  • OOP principles: encapsulation, polymorphism, inheritance, abstraction

  • classes

  • member functions: mutators, accessors, facilitators

  • constructors

  • member initialisation

  • destructors

  • static data members

  • copy constructor

  • virtual functions

  • pure virtual functions

  • abstract and concrete classes

  • inheritance vs. composition

  • member function overloading

  • difference between virtual and overloaded functions

  • static / dynamic binding

  • OOP design - REQUIRES A LOT OF THOUGHT!

  • composition / aggregation / inheritance

  • operator overloading

  • friend functions

  • overloading the stream insertion operator

  • operator overloading: global or member?

  • this pointer

  • overloading the assignment operator

  • function templates

  • class templates

  • runtime vs. compile-time/static polymorphism

  • new / delete

  • memory leaks

  • double free

  • array new[] & delete[]

  • using constructor / destructor / copy constructor / assignment operator to manage memory

  • RAII

  • object lifetime & ownership

  • OOP design principles (SOLID):

    • DRY (Don’t repeat yourself)
    • Encapsulate What Changes
    • Open Closed Design Principle
    • Single Responsibility Principle
    • Dependency Injection or Inversion principle
    • Favor Composition over Inheritance
    • Liskoff substitution principle
    • Interface Segregation Principle
    • Programming for Interface not implementation
    • Delegation principles
  • blog abour OOP design process

    • how to teach design?
    • how to assess design?
Clone this wiki locally