Click here to Skip to main content
15,897,273 members
Articles / All Topics

Robert’s Rules of Coders: #6 Don’t Use Magic Numbers

Rate me:
Please Sign up or sign in to vote.
4.89/5 (7 votes)
8 Sep 2015CPOL4 min read 7.4K   4  
When someone refers to a magic numbers in software, they probably have one of the following three scenarios in mind: A value that is used to determine the behavior of the code, but the value itself provides no meaning A value that has been hard coded in several locations in the program, that is

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Kraft Software LLC
United States United States
Rob Kraft is an independent software developer for Kraft Software LLC. He has been a software developer since the mid 80s and has a Master's Degree in Project Management. Rob lives near Kansas City, Missouri.

Comments and Discussions