|
|
|
|
|
by coldtea
3077 days 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)
|
|
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.