Awesome
correct_cpp_hello
Branch | Travis CI | Codecov |
---|---|---|
master |
Correct C++ chapter 'Hello'.
:warning: this course does not work until I've updated the scripts to use GitHub Actions :warning:
Goal
- Understand how this course works
Prerequisites
- Have created your 'Correct C++' scoreboard
Exercise
Write any program that is correct.
Feel free to just copy-paste this code to main.cpp
:
/// This program does exactly nothing
int main() {}
Note the ///
, which indicates a Doxygen documentation comment.
This is how this course works:
- Login to GitHub
- Fork this repository. See fork a chapter for help
- Clone your fork. See clone your fork for help
- Activate Travis CI for your GitHub. See activate for help
- On your local code, modify the
README.md
. See modify README for help - On your local code, do the exercise. See do the exercise for help
- Push your code. See push your code for help
- Travis will now correct your GitHub. If you did everything correctly, the build status of your fork will become green. Well done! Else, click on the red build status badge to view the Travis CI log
Your code must be correct, thus your code must:
- compile cleanly at high warning levels [1,2]
- have a low cyclomatic complexity
- have how a 100% code coverage
- have complete documentation [4]
External links
References
- [1] Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 1: 'Compile cleanly at high warning levels'.
- [2] Linus Torvalds. Re:[PATCH] Don't compare unsigned variable for <0 in sys_prctl(). 2006-11-28. Retrieved on 2010-09-20. 'Friends don't let friends use [gcc] "-W"'
- [3] John Lakos. Large-Scale C++ Software Design. 1996. ISBN: 0-201-63362-0. Chapter 2.6: 'Document the interfaces so that they are usable by others. Have at least one other developer review each interface'
- [4] Steve McConnell. Rapid Development. 1997. ISBN: 978-1-55615-900-8. Page 534: Create good documentation