Posted by on July 14, 2015

Good quality code uses very few string literals or unnamed numerical constants. Wikipedia does a great job of explaining why not to use magic values. I’ll summarise:

  1. Magic values make code harder to read and understand.

  2. Magic values are harder to alter.

  3. Magic values are hard to peer review.

  4. Magic values are hard to parameterise.

  5. Magic values make typos easy.

Read the rest on the Optimal BI blog.

Posted in: Technical

Comments

Be the first to comment.

Leave a Reply