bugs

The Ultimate Question of Programming, Refactoring, and Everything

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort.

The Ultimate Question of Programming, Refactoring, and Everything

by Andrey Karpov

From the article:

The scope of my interests − the C/C++ language and the promotion of code analysis methodology. I have been Microsoft MVP in Visual C++ for 5 years. The main aim of my articles and work in general - is to make the code of programs safer and more secure. I'll be really glad if these recommendations help you write better code, and avoid typical errors. Those who write code standards for companies may also find some helpful information here.

New updates of CppHints.com, service of recommendations on C++ programming from PVS-Studio team

New updates of C++Hints, service of recommendations on C++ programming

Changes in CppHints.com

by PVS-Studio Team

We got a lot of positive feedback from our readers and continue developing the C++Hints project. We have also answered two requests, that we saw quite often in the letters:

By this moment we have published the following articles:

The compiler is to blame for everything -- Andrey Karpov

Many programmers are very fond of blaming the compiler for different errors. Let's talk about it.

The compiler is to blame for everything

by Andrey Karpov

From the article:

When a programmer tells you that the compiler causes an error, it is a lie in 99% of cases. When you start investigating the problem, you usually find out the following reasons:

  • an array overrun;
  • an uninitialized variable;
  • a misprint;
  • a synchronization error in a parallel program;
  • a non-volatile variable used;
  • code leading to undefined behavior;
  • etc.