| Random Link ¯\_(ツ)_/¯ | ||
| Jul 26, 2022 | » | General Tips on Performance and Optimization
2 min; updated Jul 26, 2022
Trying to optimize may lead to errors and high-maintenance/change-resistant code. If there’s no need to optimize, let the code be. Only optimize performance-critical parts of a program. If your program spends 4% of its processing time doing computation A, and 40% of its time doing computation B, a 50% improvement on A is only as impactful as a 5% improvement on B. Complicated and/or low-level code is not necessarily faster than simple code. Optimizers sometimes do marvels with simple and/or high-level code. ... |
| 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. ... |