Source Code

Get familiar with the nature of the source code and compilers used throughout the course.

We'll cover the following

The source code examples–starting with the details part–shown in the course are complete. That means, assuming you have a conforming compiler, you can compile and run them. I put the name of the source file in the title of each source code example. The source code uses four whitespaces for indentation. Only for layout reasons, I sometimes use two whitespaces.

Furthermore, I’m not a fan of namespace directives such as using namespace std as they make the code more difficult to read and can pollute namespaces. Consequently, I use them only when it improves the code’s readability (e.g.: using namespaces std::chrono_literals). When necessary for layout reasons, I apply a using-declaration such as using std::chrono::system_clock. To summarize, I only use the following layout rules if necessary:

  • I indent two characters instead of four.
  • I apply the using namespace std directive.

Get hands-on with 1400+ tech skills courses.