
Questionable Comments
Two's Complement
00:00
"Apology comments" and avoiding mistakes in C++ code
Apology comments and explanations in code can be avoided by designing the API in a way that prevents certain mistakes. Instead of allowing contradictory parameters, separate functions can be written for each parameter. Similarly, by creating strong types, such as quantity classes, preconditions for values can be enforced.
Play episode from 07:00
Transcript


