These CPP modules are my first Codam projects not written in pure C. In C, we had many restrictions, such as custom functions only, a maximum of 25 lines per function, and separate variable declarations. CPP modules leave us almost completely free to do whatever we want. To get a good introduction to C++, we were only allowed to use C++ standard 98 or standard 11, to avoid immediately using of concepts like auto and lambda functions.
The project requirements also explicitly stated to use CPP concepts and not to write C-like code. This was quite difficult and first because of how used I had gotten to writing in C.
Below I shortly describe each module and what the key learning point of the module was. From CPP Module02 on, we had to always use OCF (Orthodox Canonical Form) for each class and protect variables under private. This encourages good coding practices.
- Assignment: Introduction to C++ syntax and basic concepts.
- Key learning points:
- Understanding the basic syntax of C++.
- Learning about data types and variables.
- Introduction to functions and control structures.
- Assignment: Memory allocation and pointers.
- Key learning points:
- Understanding dynamic memory allocation.
- Working with pointers and references.
- Managing memory with constructors and destructors.
- Assignment: Classes and object-oriented programming.
- Key learning points:
- Implementing classes and objects.
- Understanding encapsulation and data hiding.
- Using the Orthodox Canonical Form (OCF).
- Assignment: Inheritance and polymorphism.
- Key learning points:
- Implementing inheritance in C++.
- Understanding polymorphism and virtual functions.
- Applying OCF in derived classes.
- Assignment: Abstract classes and interfaces.
- Key learning points:
- Understanding abstract classes and pure virtual functions.
- Implementing interfaces in C++.
- Exploring the use of abstract classes in polymorphism.
Thanks to geeksforgeeks for providing explanation on most of these concepts
The CPP modules provided a comprehensive introduction to C++ and object-oriented programming. They encouraged me to understand the language's core concepts and apply them in small practical exercises.
All of the code is free to use for learning purposes!