Welcome to our Clean C++ series!

Sigh… yet another text about clean code. Yes, yes, you’re right, there is a multitude of popular (and rightly so) books available, tons of recommendations, guidelines and best practices over on the Internet that all claim to have the right answers. And that can only be a good thing. We all want to write better, cleaner code, we want to take pride in our work and call ourselves professionals. We have to strive to keep improving our craft together.
In this series of blog posts, I’ll try to present our recommendations for writing better code, as we in Connection Quest tend to do. The examples will focus on C++, but most of the ideas are applicable in your language of choice.
So, what can you expect? Throughout these posts, I’ll cover how to:
- meaningfully name your objects
- style your code
- write useful comments
- properly use types and variables
- decompose code into functions
- decide whether to use objects or data structures
- organize classes
- write generic code
- use collections
- control concurrent code
- defend against errors
- write clean unit tests
Start using these concepts one by one and you’ll be amazed at what rate your code becomes more organized, readable, maintainable and free from errors.
In the meantime, check out the works that inspired us to start writing in the first place:
– Martin, R. C. 2009. Clean Code: A Handbook of Agile Software Craftsmanship: https://sites.google.com/site/unclebobconsultingllc/books
– Martin, R. C. The Clean Code Blog: https://blog.cleancoder.com/
– Cpp Core Guidelines: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md
– Stroustrup, B. 2018. A Tour of C++: http://www.stroustrup.com/Tour.html
Stay tuned and happy coding!
