| Random Link ¯\_(ツ)_/¯ | ||
| Jun 11, 2022 | » | Testing Your Code
8 min; updated Nov 19, 2022
Why Write TestsThe later a bug is caught in the development cycle, the more expensive it is to fix it. A good test today is a future debugging session saved. The test is the first client of your code. It uncovers sub-optimal design choices, tight couplings, missed cases, etc.. ... |
| Jun 4, 2022 | » | Enumerations in C++
7 min; updated Jun 4, 2022
Unscoped (or Plain or C-Style) EnumerationsPlain (or C-style) enums are entered in the same scope as the name of their enum, and implicitly convert to their integer value, e.g. The name can be omitted if it’s not going to be used, e.g. Unnamed enums are common in code written before alternative ways of specifying integer constants, e.g. ... |
| May 31, 2022 | » | Resource Management in C++
4 min; updated May 31, 2022
Resource HandlesRAII is also covered in Classes in C++ > Motivation for the Destructor Mechanism The constructor/destructor pattern enables objects defined in a scope to
release the resources during exit from the scope, even when exceptions
are thrown. All standard-library containers, e.g.
|
| May 12, 2022 | » | Classes in C++
15 min; updated May 12, 2022
A class is a user-defined type provided to represent a concept in the code of a program. Essentially, all language facilities beyond the fundamental types, operators, and statements exist to help define better class or to use them more conveniently. Sometimes I have problems defining the concept that is going to be
encapsulated as a class. Other times, the naming is hard, and I result
to common patterns like |
quotes Doug McIlroy:
What is the context of this quote?