From 9772c6b20671235a148a22b141af31bc3afd0844 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 17 May 2024 16:34:52 -0500 Subject: [PATCH 01/10] Add draft for build systems --- .../modules/compilation-model/buildsystems.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/modules/compilation-model/buildsystems.md diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md new file mode 100644 index 0000000..7fa4159 --- /dev/null +++ b/sources/modules/compilation-model/buildsystems.md @@ -0,0 +1,110 @@ +## Module name: Build systems + +_Skeleton descriptions are typeset in italic text,_ +_so please don't remove these descriptions when editing the topic._ + +### Overview + +_Provides a short natural language abstract of the module’s contents._ +_Specifies the different levels of teaching._ + +------------------------------------------------------------------------ +Level Objective +----------------- ------------------------------------------------------ +Foundational --- Knowledge about build systems + +Main --- Usage of build system to compile a executable + +Advanced --- Usage of build system to compile a library or + add external libraries as a dependencies + +------------------------------------------------------------------------ + +### Motivation + +_Why is this important?_ +_Why do we want to learn/teach this topic?_ + +* Building complex C++ projects by hand or writing Make files is tricky +* Build systems can help to resolve dependencies +* Build systems can help do distribute C++ code and help other to compile the code +* Build systems can help to find and include libraries as dependencies +* All major C++ projects are distributed with build systems + +### Topic introduction + +_Very brief introduction to the topic._ + +Build systems are used to configure, build, and install complex C++ projects. + + +### Foundational: Knowledge about build systems + +#### Background/Required Knowledge + +A student: +* Should know about build systems + + +#### Student outcomes + +_A list of things "a student should be able to" after the curriculum._ +_The next word should be an action word and testable in an exam._ +_Max 5 items._ + +A student should be able to: + +1. To explain what a build system is +2. Know that a build systems resolves dependencies +3. Know that a build system support cross-platform compilation + +#### Caveats + +_This section mentions subtle points to understand, like anything resulting in +implementation-defined, unspecified, or undefined behavior._ + +None + +#### Points to cover + +_This section lists important details for each point._ + +* Mention that many build systems are available for C++. +* Mention benefits and challenges + +### Main: Usage of build system to compile a executable + +#### Background/Required Knowledge + +* All of the above. + +#### Student outcomes + +A student should be able to: + +1. Write a configuration file to compile a C++ program with a main method +2. Use the build system to generate the executable + +#### Caveats + +The instructions are restricted to the chosen build system and +not easily transferable. + + +#### Points to cover + +* Adding include paths to header files +* Adding compiler flags +* How to build Release and Debug builds + + +### Advanced + +_These are important topics that are not expected to be covered but provide +guidance where one can continue to investigate this topic in more depth._ + +* How to build libraries +* How to include libraries to the executable +* How to find external libraries and include them +* How to add support for different compilers +* How to add support for different operating systems From ac383ec48c5a4b208f60ebd6123821084529c909 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Fri, 26 Jul 2024 09:46:54 -0600 Subject: [PATCH 02/10] Update buildsystems.md Discussion with the US group --- .../modules/compilation-model/buildsystems.md | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 7fa4159..55e43a3 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -25,11 +25,12 @@ Advanced --- Usage of build system to compile a library or _Why is this important?_ _Why do we want to learn/teach this topic?_ -* Building complex C++ projects by hand or writing Make files is tricky +* Building complex C++ projects by hand is tricky * Build systems can help to resolve dependencies * Build systems can help do distribute C++ code and help other to compile the code * Build systems can help to find and include libraries as dependencies -* All major C++ projects are distributed with build systems +* Build systems faciliate project management +* All major C++ projects are distributed with build systems ### Topic introduction @@ -43,7 +44,7 @@ Build systems are used to configure, build, and install complex C++ projects. #### Background/Required Knowledge A student: -* Should know about build systems +* Should know how to compile and link C++ programs #### Student outcomes @@ -55,8 +56,8 @@ _Max 5 items._ A student should be able to: 1. To explain what a build system is -2. Know that a build systems resolves dependencies -3. Know that a build system support cross-platform compilation +2. To explain a build systems resolves dependencies +3. To explain a build system supports compilation for different operating systems and architectures #### Caveats @@ -69,8 +70,9 @@ None _This section lists important details for each point._ -* Mention that many build systems are available for C++. +* Mention that many build systems are available for C++ * Mention benefits and challenges +* Build system help to only compile the C++ files with code changes and not the complete project ### Main: Usage of build system to compile a executable @@ -82,8 +84,10 @@ _This section lists important details for each point._ A student should be able to: -1. Write a configuration file to compile a C++ program with a main method -2. Use the build system to generate the executable +1. Download a C++ package and build the package +2. Write a configuration file to compile a C++ executable +3. Pass compiler options via the build system +4. Use the build system to generate the executable #### Caveats @@ -96,6 +100,8 @@ not easily transferable. * Adding include paths to header files * Adding compiler flags * How to build Release and Debug builds +* Linking external libraries to the C++ project +* Support different operating systems, compilers, and architectures ### Advanced @@ -103,8 +109,7 @@ not easily transferable. _These are important topics that are not expected to be covered but provide guidance where one can continue to investigate this topic in more depth._ -* How to build libraries -* How to include libraries to the executable -* How to find external libraries and include them -* How to add support for different compilers -* How to add support for different operating systems +* How to build libraries +* Write a configuration file for your own library +* How to have external libraries be downloaded during the build process + From ecbec3b702563e64f9249d9f9dfc15bc99d5822f Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Thu, 26 Sep 2024 09:28:18 -0600 Subject: [PATCH 03/10] Typos --- sources/modules/compilation-model/buildsystems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 55e43a3..fd6a97d 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -56,8 +56,8 @@ _Max 5 items._ A student should be able to: 1. To explain what a build system is -2. To explain a build systems resolves dependencies -3. To explain a build system supports compilation for different operating systems and architectures +2. To explain that a build systems resolves dependencies +3. To explain that a build system supports compilation for different operating systems and architectures #### Caveats From 646500521c217714e8b29b15961b58c6b37cb2b1 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Thu, 26 Sep 2024 09:29:22 -0600 Subject: [PATCH 04/10] More typos --- sources/modules/compilation-model/buildsystems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index fd6a97d..85e11d4 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -97,7 +97,7 @@ not easily transferable. #### Points to cover -* Adding include paths to header files +* Include paths to header files to the configuration * Adding compiler flags * How to build Release and Debug builds * Linking external libraries to the C++ project From f50e498b4aabf030e44ae061d310ed79a02f6d44 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:00:59 -0600 Subject: [PATCH 05/10] Update buildsystems.md Mention unit testing --- sources/modules/compilation-model/buildsystems.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 85e11d4..5bd0fc0 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -112,4 +112,5 @@ guidance where one can continue to investigate this topic in more depth._ * How to build libraries * Write a configuration file for your own library * How to have external libraries be downloaded during the build process +* Mention that build systems provide support for unit testing From 430c317b53ce1a2950ff8859c554b5365fcf7c4b Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:06:50 -0600 Subject: [PATCH 06/10] Update buildsystems.md Move building a lib and link it to a C++ executable to the main level --- sources/modules/compilation-model/buildsystems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 5bd0fc0..7666771 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -88,6 +88,7 @@ A student should be able to: 2. Write a configuration file to compile a C++ executable 3. Pass compiler options via the build system 4. Use the build system to generate the executable +5. Write a configuration file to compile a library and link the library to a C++ executable #### Caveats @@ -110,7 +111,6 @@ _These are important topics that are not expected to be covered but provide guidance where one can continue to investigate this topic in more depth._ * How to build libraries -* Write a configuration file for your own library * How to have external libraries be downloaded during the build process * Mention that build systems provide support for unit testing From ee55d0e2b732f281e0ce70687d48e10e65e87d55 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:08:42 -0600 Subject: [PATCH 07/10] Update buildsystems.md --- sources/modules/compilation-model/buildsystems.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 7666771..5b5e4ac 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -15,8 +15,7 @@ Foundational --- Knowledge about build systems Main --- Usage of build system to compile a executable -Advanced --- Usage of build system to compile a library or - add external libraries as a dependencies +Advanced --- Add external libraries as a dependencies ------------------------------------------------------------------------ @@ -88,7 +87,7 @@ A student should be able to: 2. Write a configuration file to compile a C++ executable 3. Pass compiler options via the build system 4. Use the build system to generate the executable -5. Write a configuration file to compile a library and link the library to a C++ executable +5. Write a configuration file to compile a library and link the library to a C++ executable #### Caveats From cbbfbe2c3abd5beff8301c1277b3bc621496fd0b Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Thu, 31 Oct 2024 09:05:06 -0600 Subject: [PATCH 08/10] make it more precise --- sources/modules/compilation-model/buildsystems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 5b5e4ac..8e14fa0 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -101,7 +101,7 @@ not easily transferable. * Adding compiler flags * How to build Release and Debug builds * Linking external libraries to the C++ project -* Support different operating systems, compilers, and architectures +* Support compilation on different operating systems, compilers, and architectures ### Advanced From ec04360a905b341d3b923ae1183c7a61981400a1 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Thu, 27 Mar 2025 10:09:21 -0600 Subject: [PATCH 09/10] Add draft for constructors --- sources/modules/object-model/constructors.md | 98 +++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/sources/modules/object-model/constructors.md b/sources/modules/object-model/constructors.md index 41d0ab6..8895ead 100644 --- a/sources/modules/object-model/constructors.md +++ b/sources/modules/object-model/constructors.md @@ -3,4 +3,100 @@ _Skeleton descriptions are typeset in italic text,_ _so please don't remove these descriptions when editing the topic._ -This topic is currently under construction and will soon be filled with information :) +### Overview + +_Provides a short natural language abstract of the module’s contents._ +_Specifies the different levels of teaching._ + +------------------------------------------------------------------------ +Level Objective +----------------- ------------------------------------------------------ +Foundational: Declaration of constructors + +Main: Initialization and overloading + +Advanced: TBD + +------------------------------------------------------------------------ + +### Motivation + +_Why is this important?_ +_Why do we want to learn/teach this topic?_ + +Constructors are fundamental to generate objects from classes and structs, so understanding them is essential to work with objcets. + +### Topic introduction + +_Very brief introduction to the topic._ + +### Foundational: Basic use of constructors + +#### Background/Required Knowledge + +A student: + +1. should know the notion of classes and structs + +#### Student outcomes + +_A list of things "a student should be able to" after the curriculum._ +_The next word should be an action word and testable in an exam._ +_Max 5 items._ + +A student should be able to: + +1. Add constructors to classes and structs +2. Explain different types of initialization +3. Explain compiler provided constructors when these are provided, what these do, and when these go away +4. Explain differences between creating an object and declare a variable + +#### Points to cover + +* Overloading of constructors and default arguments +* Copy constrcutor and destructor +* Constructors can be used to initialize class members +* + +#### Caveats + +_This section mentions subtle points to understand, like anything resulting in +implementation-defined, unspecified, or undefined behavior._ + +* programming user interfaces in C++ and in general require plenty of boiler plate code +* API calls are specific to one library and might not be transferable to other libraries +* Some libraries are written in C + +### Main: Command of supporting mechanisms and tools + +#### Background/Required Knowledge + +* All of the above. + +#### Student outcomes + +A student should be able to: + +1. add more advanced elements, like tables or images +2. handle multiple windows +3. show error and warning popups +4. use different forms of IO, like keyboard, mouse, or touch pad +5. explain basic of fonts and accessibility + +#### Caveats + +* programming user interfaces is rather complex and might not applicable for most students + +#### Points to cover + +* More advanced API calls and design patterns + +### Advanced: Technicalities and tools + +_These are important topics that are not expected to be covered but provide +guidance where one can continue to investigate this topic in more depth._ + +* Internationalization +* Font designers +* Hardware acceleration +* Custom widget generation From 47b6a7636ab098a6bdc7eaa8d3be35e2bf710b3b Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Thu, 26 Jun 2025 10:49:46 -0600 Subject: [PATCH 10/10] Update --- sources/modules/object-model/constructors.md | 47 +++++++++++--------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/sources/modules/object-model/constructors.md b/sources/modules/object-model/constructors.md index 8895ead..7aa8628 100644 --- a/sources/modules/object-model/constructors.md +++ b/sources/modules/object-model/constructors.md @@ -11,7 +11,7 @@ _Specifies the different levels of teaching._ ------------------------------------------------------------------------ Level Objective ----------------- ------------------------------------------------------ -Foundational: Declaration of constructors +Foundational: Basic usage of constructors Main: Initialization and overloading @@ -36,7 +36,7 @@ _Very brief introduction to the topic._ A student: -1. should know the notion of classes and structs +1. should know the notion of classes and structs %todo link to classes #### Student outcomes @@ -54,49 +54,56 @@ A student should be able to: #### Points to cover * Overloading of constructors and default arguments -* Copy constrcutor and destructor +* Copy constructor and destructor * Constructors can be used to initialize class members -* #### Caveats _This section mentions subtle points to understand, like anything resulting in implementation-defined, unspecified, or undefined behavior._ -* programming user interfaces in C++ and in general require plenty of boiler plate code -* API calls are specific to one library and might not be transferable to other libraries -* Some libraries are written in C +* None -### Main: Command of supporting mechanisms and tools +### Main: #### Background/Required Knowledge * All of the above. +* Class inheritance %todo check for link +* Dynamic memory +* Difference between shared and unique pointers #### Student outcomes A student should be able to: -1. add more advanced elements, like tables or images -2. handle multiple windows -3. show error and warning popups -4. use different forms of IO, like keyboard, mouse, or touch pad -5. explain basic of fonts and accessibility +1. Explain the differences between the big five, namely, copy constructor, move constrcutor, copy/assign, move/assign, destructor, and constructor. +2. Construct a initializer list and explain conditions when it is necessary +3. Delegate to the constructor of the base class +4. Demonstrate and explain safe memory handling using shared or unique pointers +5. Define what RAII is and the role of the constructor #### Caveats -* programming user interfaces is rather complex and might not applicable for most students +* Order of construction should match the initalizer list order #### Points to cover -* More advanced API calls and design patterns +* Not calling virtual functions from the base class +* Do not initialze data outside of the constructor (two face initialization) +* Difference between assignment and deep copy -### Advanced: Technicalities and tools +### Advanced: _These are important topics that are not expected to be covered but provide guidance where one can continue to investigate this topic in more depth._ -* Internationalization -* Font designers -* Hardware acceleration -* Custom widget generation +* Error handling within constructors +* Non-static data initialziers +* Constructors with member references +* Purposes for protected constructors +* What does delete vs private means +* What does it mean to have an explicit constructor +* Impact on const expr on constructor %extend later +* Rules on memory ordering %extend later +* Define constructor outside of the body of the class %extend later