3 ms·
I think if you can't reliably find all occurrences of a value then it shouldn't be hardcoded - 6.022e23 is easier to find in a large source file than 5. If you
by zwieback 11y ago
I think if you can't reliably find all occurrences of a value then it shouldn't be hardcoded - 6.022e23 is easier to find in a large source file than 5. If you work in a statically typed language with a decent IDE you can usually see the constant value just by hovering over the identifier.
I'm guessing there are different tradeoffs in dynamically typed languages since the hardcoded number will also identify the type.