4 ms·
> Why do you need constants? How can you argue that types are necessary but simultaneously permit magic numbers? Magic numbers like Pi?
by MikeUt 5y ago
> Why do you need constants? How can you argue that types are necessary but simultaneously permit magic numbers?
Magic numbers like Pi?
- erhk 5y agoIn my experience any constants in enterprise are best defined in config or as flags, something like a mathematical constant would ideally come from a library(math.pi for python), would be interested in counter examoles
- MikeUt 5y agoYou can assign a new value to math.pi in python. You can assign new values to those 'constants' defined in config files. If a value must not change for the lifetime of a program, you are unable to enforce that constraint, leading to bugs.