3 ms·
This is a good idea. Most modern languages have their own build tool which handle most of these things, so this requires some separate learning with C++. Some
by williamvds 4y ago
This is a good idea. Most modern languages have their own build tool which handle most of these things, so this requires some separate learning with C++.
Some ideas for a curriculum:
Context
- C++ as a standard, compilers as implementations
- a build tool's role in handling compilation and linking
- compilers having limited abilities, having limited warnings and analysis by default
Build tools
- evolution: e.g. make -> autotools, cmake, meson
- focus on meson as the build tool of choice (personally I'd avoid CMake since it has a lot of legacy baggage)
Testing
- gtest/gmock
- catch
- designing for testing
Analysis tools
- why you should care: security, catching bugs
- cranking up built-in compiler warnings to reasonable standards
- external tools like clang-tidy, cppcheck
- sanitizers: address sanitizer, leak, thread, etc.
- fuzzing
Dependency management (probably the toughest, since it's still a mess)
- history: usually just relying on system packages, or installing libraries globally from source
- Conan (probably the best option for simple dependencies that's actually catching on)
- CMake external projects, Git submodules
- Docker
- Nix (if you're feeling adventurous)
- bluGill 4y agoHaving build tools in the language is a negative if you have more than one language in your project has two build tools. Sure it is easier for simple projects, but C++ is not for simple projects.
- MakisH 4y agoIn a C++ course we teach at the Technical University of Munich (for students coming from a non-CS background), this is pretty much the direction we have recently steered the curriculum. It is amazing how we were always expected to "just figure out" all these very important practical aspects by ourselves as students, while these are so complicated for C++. In combination with a lot of outdated material out there, students end up feeling lost and giving up, or going through a lot of pain to develop even simple projects.
- vxNsr 4y agoI always thought the pain was the point. They wanted you to struggle to figure it out, it’s how you learned how to learn. If everything is spoon-fed you end up unable to solve your problems when they arise. You expect someone else to have solved the problem and you start looking for them instead of attempting to solve it yourself. Kinda like the main plot point of Enders game.
- MakisH 4y agoI understand your point, and I had to argue on it a lot when introducing such changes. I think the answer is struggling for the right task, but again with some guidance. If the learning outcome is to learn to program, then I don't see why you should waste half a semester trying to figure out by yourself the technicalities that could help you go beyond a hello world. Similarly, I don't believe we should (nowadays) force people to write everything in the terminal using Vim. The additional cognitive load is too distracting that it prevents you from digging deeper. One can say "but that's how I learned, and I am fine and shine today". This is probably true, but then I believe that such a person had the right background to anyway learn by themselves. I see our mission as teachers to help the students that actually need the help, rather than letting them give up too early, in favor of some kind of excellence evolution. And I believe that if we prepare the right groundwork (explaining all the ropes before we start pulling them), then even the more advanced students will be able to learn even more that they would by themselves in a more struggling environment.
- willhslade 4y agoSelf learning is part of the university experience. Researching without guidance is not.
- jcelerier 4y ago> It is amazing how we were always expected to "just figure out" all these very important practical aspects by ourselves as students, while these are so complicated for C++. In france when I started engineering school (early 2010s) we had classes about: - using the shell, emacs, being at least basically proficient unix tools - using make, cmake, configuring compilers etc wild that it isn't more common, this explains a lot!