Category cpp_nibble

#051 – Introduction to random number generation in C++

An application might need to generate random numbers for various reasons. Calculating damage in games, statistical modelling and cryptography. Unfortunately, computers are incapable of generating truly random numbers, since their designed to be deterministic. Thus, a contradiction appears. The workaround…

#047 – Chained, independent, and nested ifs

Everyone’s familiar with if/else conditional statements. However, there are three variants that differ slightly: Chained vs. independent: a side-by-side Consider two functions modelling a security system. securityPriority() uses a chained if/else if; securityDiagnostic() uses independent ifs. In the first function, which is…