C++ Programming SS2020

Important news

Course Organization & First Lecture

Due to the current Coronavirus situation the course will be taught online. The lectures will be recorded and uploaded to PANDA every Friday. The first lecture will be uploaded on Friday, 17th.

The accompanying exercise classes will start next week on Friday, 24th. We wish to implement the exercise classes in a more active manner and plan to have a livestream on Fridays starting at 16:00. During the livestream I will present possible solutions to the respective exercise sheets and answer all of your questions (that you can ask using the chat functionalities of the stream). Further details regarding the livestream will be provided as soon as possible.

You can ask questions regarding the exercise sheets as well as the overall topics of the lecture---in an asynchronous manner---using PANDA's Q&A.

Registration

Please register for the course in PAUL (L.079.08504 "C++ Programming" if possible) and in the University's PANDA system: https://panda.uni-paderborn.de/course/view.php?id=13119.

As the course itself is registered in Studium Generale (SG), not everyone may be able to register themselves in PAUL. However, I created an open course in PANDA to which anyone can sign up for.

Course material

The slides and exercise sheets will be uploaded on this page. The lecture recordings are available on YouTube at https://youtube.com/playlist?list=PLamk8lFsMyPWKlBarQkNPeeRgpjPRA8Jm.

 

Material
slidesexercisescode

slides_00

slides_01

slides_02

slides_03

slides_04

slides_05

slides_06

slides_07

slides_08

slides_09

slides_10

slides_11

slides_12

sheet_00

sheet_01

sheet_02

sheet_03

sheet_04

sheet_05

sheet_06

sheet_07

sheet_08

sheet_09

nullptr

sheet_11

sheet_12

 

nullptr

code_01

code_02

code_03

code_04

code_05

nullptr

code_07

code_08

initial_grid.txt

nullptr

code_11

nullptr

 

The gtest framework example showed in the exercises: gtest_example.zip

For details please refer to: https://github.com/google/googletest

 

Compiler builtins for over-/ underflow detection:

    VirtualBox machine image containing an Ubuntu OS with different C++ compilers (gcc, clang) and development environments (VS Code, etc.) pre-installed:

    • cppp20.ova (caution the virtual machine image comes as a 7.1 GB compressed file, the uncompressed file is approx. 15 GB in size).
    • password: 'cppp'

    To run the virtual machine you need to install VirtualBox. Please download the Virtual Box plattform package for your corresponding operating system (and install it). You probably wish to install the VirtualBox Extentsion Pack as well. Once VirtualBox is installed you can run it. Import the virtual machine (.ova file): In the 'File' menu of VirtualBox please choose 'Import Appliance' and follow the instructions. After having successfully imported the machine you should be able to start it and a new window with the Ubuntu OS booting should pop up. (You do not have to set things up in advance; this is part of the first exercise.)

    A simple Makefile and CMake project can be found in the '~/Programs/' directory of the virtual machine.

    Time and place

    The teaching language will be English, but questions in German will be permitted.

    Due to the current situation the course will be taught online.

    Lectures:

    Fri 14:00-16:00 (recorded lectures, PANDA)

    Exercise classes:

    Fri 16:00-18:00 (livestreams, https://www.twitch.tv/pdschubert/)

    Registering and asking questions

    You have to register in the PAUL system in order to attend the course.

    Please feel free to ask questions during the exercises or send mail.

    Abstract

    C++ is a general purpose programming language and one of the most popular languages for both, systems and application programming. The language allows for writing programs close to the metal and gives the programmer full control over the system's resources. However, C++ includes decent mechanisms for abstractions as well. Another observation is that programs written in C++ often result in highly efficient machine code as the the language maps very well to the von Neumann architecture. These are just a few characteristics of the language which make it to be in great demand.


    The more recent standards such as C++11, C++14, C++17, and C++20 (often called modern C++) provide new powerful mechanisms and concepts that make programming in this language a lot easier than a few years ago.


    During this course you will learn the basics (and probably a lot more) about modern C++.

    Prerequisites

    The C++ programming language is taught from scratch, so students without any programming background are welcome!

    Syllabus

    During the semester, we are going to study the following concepts in C++ programming:

    Background and basic introduction:

    • history of C and C++
    • programming environments
    • basic terms / concepts

    Basic C++ programming:

    • primitive variable types
    • expressions / statements
    • functions
    • memory management / pointers / arrays
    • structures / unions / enumerations
    • strings / vectors
    • classes
    • smart pointers / move semantics

    The C++ standard template library (STL):

    • IO library
    • containers
    • generic algorithms

    Advanced techniques:

    • operator overloading
    • template programming
    • object-oriented programming
    • embarrassing parallel: OpenMP

    Useful libraries for further projects:

    • commonly used C++ libraries

    Learning outcomes

    • understand modern C++
    • be confident to take advanced courses that require C++ programming
    • the ability to easily realize elegant programming tasks / projects
    • promoted from a C programmer to a state-of-art C++ programmer
    • the ability to develop a real object-oriented program
    • gain additional understanding of how a computer works
    • better understanding of (computational) problems
    • know where to find the desired information to realize a challenging task on your own

    Useful literature

    [1] A Tour of C++, Stroustrup 2013 (overview)

    [2] The C++ Programming Language (4th Edition), Stroustrup 2013 (details)

    [3] C++ reference: http://en.cppreference.com (reference)

    [4] C++ Tutorial: http://www.cplusplus.com/doc/tutorial/ (a nice tutorial)

    [5] CppCon experts sharing their knowledge: https://www.youtube.com/user/cppcon (really advanced concepts)

    Assignments

    There will be weekly exercise sheets. The aim of the exercise sheets is to deepen your knowledge and your understanding of the C++ programming language. You need to achieve at least 50% of all points to be admitted to the final project.

    In the final project you have to create a small command-line application which implements a useful algorithm. During the project you will make use of the previous learned contents.

    The weekly exercise classes (see above) serve the following purposes: present the solution of the previous exercise sheet, answer questions and give some hints for the current exercise sheet.

    If you have questions to the organization of the course, the topic, to the exercises or you get stuck during solving the exercises, please contact me via email. I try to answer as soon as possible.