866ai

What to Do When Your Constants Are Someone Else's Law

· 0 次浏览 ·来源: freeCodeCamp
A colleague once asked me why a number in my code had a comment three lines long. The number was 18 . The comment said which rule it came from, which section notified it, and that it could change without warning. That felt like a lot of ceremony for a two-digit integer — until I remembered the alternative. In most software, a constant is a decision you made....

A colleague once asked me why a number in my code had a comment three lines long. The number was 18 . The comment said which rule it came from, which section notified it, and that it could change without warning. That felt like a lot of ceremony for a two-digit integer — until I remembered the alternative. In most software, a constant is a decision you made....

A colleague once asked me why a number in my code had a comment three lines long. The number was 18 . The comment said which rule it came from, which section notified it, and that it could change without warning. That felt like a lot of ceremony for a two-digit integer — until I remembered the alternative. In most software, a constant is a decision you made....