4 ms·
Without the convenience of autocomplete and re-use in other places in the code, and with a comment that can always get out of sync with what the code does much
by coldtea 9y ago
Without the convenience of autocomplete and re-use in other places in the code, and with a comment that can always get out of sync with what the code does much easier than a named constant.
- phkahler 9y agoMy comment was a bit weak. Putting something more of a requirement or design intent in the comment is better. Having it all there can be better than a well described constant with a definition somewhere else. Sure, they could get out of sync but at least you'll be able to see the discrepancy right there on that line if you're looking. But to each their own.