Skip to content

Latest commit

 

History

History
325 lines (248 loc) · 14.4 KB

session_plans.md

File metadata and controls

325 lines (248 loc) · 14.4 KB

Week 1

Introduction to the command-line, first steps

First project: DNA shotgun sequencing, input/output, functions


Week 2

Multi-file project, error handling

More string handling, basic debugging


Week 3

Advanced string formatting, structs & classes

Classes in C++


Week 4

Next project: functional MRI

Using external libraries, operator overloading


Week 5

Robot arm project & inheritance

Robot arm project & inheritance

  • work on project
  • practice class inheritance, etc

Week 6

OOP design and principles

  • aggregation, composition, inheritance
  • 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
  • UML overview
  • UML class diagrams
  • typical workflow for the OOP design

Peer marking

  • Peer marking
  • go through solution and marking scheme
  • ...?

Week 7

stringstream, finalise robot arm project

  • more practise with for loops, functions, and file I/O
  • Introduce std::istringstream
  • finalise robot arm project

TBC


Week 8

Practice session: design and initial implementation

Practice session: finalise project


Week 9

Lambda expressions & template programming

Templates and the Standard Template Library


Week 10

Pointers and manual memory management

  • pointers
  • C-style arrays
  • C-style string handling
  • new / delete
  • memory leaks
  • double free
  • array new[] & delete[]

Handling memory in C++ classes

  • using constructor / destructor / copy constructor / assignment operator to manage memory
  • smart pointers?
  • RAII?

Topics not yet covered:

  • type aliasing
  • returning multiple values from functions using C++17 structured binding
  • using std::string_view to avoid copies
  • conditional (ternary) operator (?:)
  • Resource Acquisition Is Initialization (RAII)
  • the function stack
  • recursion
  • categories using enumerated types (enums)
  • class destructor
  • multi-line comments and why they're usually best avoided
  • dynamic vs. static type checking
  • std::array
  • difference between std::vector::operator[] and std::vector::at() in terms of bounds checking
  • expressions with mixed types, implicit type casting, integer promotion, ...
  • 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!
  • UML
  • composition / aggregation / inheritance
  • operator overloading
  • friend functions
  • operator overloading: global or member?
  • this pointer
  • overloading the assignment operator
  • runtime vs. compile-time/static polymorphism
  • object lifetime & ownership
    • relationship to composition & aggregation, etc.
  • OOP principles: encapsulation, polymorphism, inheritance, abstraction
  • 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

Open questions:

  • how use inheritance in a meaningful way without pointers?
    • should be fine using references instead
  • how to demonstrate aggregation without pointers?
  • blog abour OOP design process
    • how to teach design?
    • how to assess design?

NOT covered in course: