3 ms·
> but renaming every integer seems senseless. When the integer itself is self-explainatory but you can't just assign the integer as a name. For example: c
by inetknght 6y ago
> but renaming every integer seems senseless.
When the integer itself is self-explainatory but you can't just assign the integer as a name.
For example:
constexpr int 42 = 42; // compiler error
So instead:
constexpr int fourtytwo = 42; // yay!
However the obviousness of what 42 means is debatable.
int universe = fourtytwo; // why?
int sum = fourtytwo; // sum... of what?
int magic = fourtytwo / 7;
- sandworm101 6y ago"What do you get if you multiply six by nine?" = 42
- bluesmoon 6y agountil someone runs a spellcheck on this code and changes all locations to fortytwo
- inetknght 6y agoFourtytwo: a number equaling four amounts of ten plus two singular amounts. Fortytwo: a defensive fortification with a nickname. See also Boaty McBoatface.
- deleted 6y ago[deleted]