3 ms·
>How do you know that it's the "E" that is wrong, and not the ASCII_A? Maybe it should be ASCII_E. Ultimately you don't, but ASCII_A requires double the intent
by coldtea 9y ago
>How do you know that it's the "E" that is wrong, and not the ASCII_A? Maybe it should be ASCII_E.
Ultimately you don't, but ASCII_A requires double the intentional actions to name it and have it also be 'A', whereas 'A' vs 'E' or whatever else is a much easier typo.
It's the whole idea behind NOT having magic values in your code. That is, that:
if (temp > 212)
tells us much less than:
if (temp > WATER_BOILING_TEMP)
and that we can more easily spot an error with:
WATER_BOILING_TEMP = 275
than with:
if (temp > 275)
- dragonwriter 9y ago275°F is about right at a little over 3 bar. Or 275°C at around 60 bar.
- icebraining 9y agoUltimately you don't, but ASCII_A requires double the intentional actions to name it and have it also be 'A', whereas 'A' vs 'E' or whatever else is a much easier typo. Unless, as I wrote after, you have both ASCII_A and ASCII_E declared, which wouldn't be surprising. I don't find the "spot the error" argument to be very convincing; I still name stuff, but just for the semantic value.