News for hackers. Stuff that matters.
Re:Skills Poor Programmers Lack by torgard on Sunday July 21, 2019 @01:19PM (#20492400)
It took me a while to understand the whole "no magic numbers" thing.

I was basically just told that most (if not all) numbers should be stored in constants. So I just added int twentyFive and stuff, and it annoyed me, but my teacher was happy.

Much later, I realized the missing part: Name the constant not what it is, but rather what it does. So int rightBoundary instead of twentyFive, and the code suddenly becomes much more readable.

There are no comments on this comment yet.