No Magic Numbers use Named Constants #216
SorenKlemmensen
started this conversation in
BC Best Practices
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Too often I see people that assign unexplained meaning to "random" numbers. We see this standard if people refer to objects by number or options by the integer value, however it happens too when importing file formats outside our control or people try to sort stuff with more. Best practices should be "No Magic Numbers". Use meaning full abstractions that make the code readable instead.
Magic Numbers obscured the intent for the reader.
This has been touched on in
https://alguidelines.dev/docs/bestpractices/named-invocations/
however I think it is a bigger issue better covered by "No Magic Numbers" in general.
Please discuss
Beta Was this translation helpful? Give feedback.
All reactions