DEV Community

Anastasiia Ogneva
Anastasiia Ogneva

Posted on

Terrible tips for a C++ developer

Let's talk about bugs and bad coding practices. There are many guides on this topic. I would like to recommend an interesting and non-standard compilation of terrible tips. Andrey Karpov, the author of fascinating articles about C++, has published a mini-book - "60 terrible tips for a C++ developer". This is a case when reading about programming is both useful and entertaining.

Image description

The book can come in handy not only for C++ developers, it has some general "tips" for all programmers. It is especially useful for beginners who want to know what is right and what is wrong.

Each terrible tip is brief and easy to understand. And the main thing is that everything is based on some real-life cases. It's not just a list of terrible tips, but a practical guide that helps developers avoid typical coding mistakes

Here are some fragments from the book that made me smile me:

Terrible tip N6. Invisible characters.
The author has a point that using them in your code makes things magical, and it's "cool." That sounds like fun. But seriously, such character sequences can cause the developer and the compiler to interpret the code differently.

Terrible tip N21. Professionals do not make mistakes
The point here is that there are experts who understand better than anyone else how to code and how to test. But in fact, they are subjected to a cognitive bias — "illusory superiority" — just like all of us, honestly. In general, all developers need to check their code.

Terrible tip N51. For as long as possible, resist using the new C++ standard
It is better and more efficient to switch to a new version of the language, but some developers may say that they stick to the old standard just in case. They say this is because someday their project may be in demand on platforms with outdated compilers. However, this may never happen. The tip may seem obvious, but it would be a good idea for developers to think about it again.

Image description

In addition to such tips, there are some points that show how to avoid typical bugs and create a clean and reliable code.

To summarize, I would describe this mini-book as informative, entertaining, and easy to understand.

You can find the full version of the book here

Top comments (0)