This lesson is still being designed and assembled (Pre-Alpha version)

Basic Modern C++: Glossary

Key Points

Introduction
  • C++ is a compiled language, source code is translated by the compiler to machine specific binaries.

  • Well written C++ can achieve very high performance.

  • Using the compiler on the command line I can simple and run a simple C++ program.

Core Syntax and Types
  • Introdution into basic syntactical concepts of C++

  • Definition and explanation of the most basic C++ types

Arrays and Vectors
  • C++ can assign fixed sized collections as arrays.

  • C++ can manage variable sized collections as vectors of objects.

  • For vectors, data elements can be added and removed, as well as updated.

Basic C++ operators
  • Be careful with increment operators, which have a left-side and a right-side version.

  • Prefer using explicit parentheses over relying on complex precedence rules.

  • There is no predefined power operator.

Compound datatypes
  • Will follow

Functions
  • Const references avoid the cost of the copy for input arguments.

  • You should not be afraid any more of returning big results.

  • You should not be afraid any more of returning a bunch of results.

References
  • Coming up.

Control Instructions
  • Control instructions make your code powerful and versatile.

  • You may need to test your program against different inputs for some code blocks to execute.

Headers and Interfaces
  • Preprocessor directives are useful for making compile-time decisions

  • By separating header files and implementation files we can program to interfaces, not implementations.

Templates
  • There are function and class templates.

  • Template parameters can be types or integers known at the compile time.

  • This is all managed at compile time.

  • All the code must stay in header files.

  • Beware of code bloat.

  • Specialization enable to handle special parameter values, but also imply some hassle, especially when mixing templates with inheritance or implicit conversions.

  • Before C++20, there is no simple way to define constraints on the allowed values for template parameters.

Type inference
  • The new keyword auto avoid you the error-prone typing of complex long type names.

  • A collateral benefit is that the code is more generic.

  • Yet, do not overuse auto, because the types contribute to the readability of the code.

Classes
  • Will follow

Sum types
  • Will follow

Code inclusion
  • Put your code snippets in _episodes/code/

  • There are three different ways to include code.

Glossary

FIXME