>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:
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.
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.
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:
tells us much less than: and that we can more easily spot an error with: than with: