Magic numbering in C# programming.

Hi there;

My supervisor told me that I should avoid magic numbering in C# programming.

What is this? Can you provide an example?

Kind regards.
LVL 12
jazzIIIloveAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
0
 
dexterrajeshCommented:
hi,

magic numbering is a practice of defining\using hard coded values when you write your code.

why to avoid magic numbering: poor readability and understanding

for better readability and understanding of the source code use enums by giving meaningful names... this is the good practice to avoid magic numbering...
0
 
jazzIIIloveAuthor Commented:
Thanks angellll
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.