Solved

Magic numbering in C# programming.

Posted on 2011-09-12
3
387 Views
Last Modified: 2012-06-27
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.
0
Comment
Question by:jazzIIIlove
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 36522044
0
 
LVL 9

Expert Comment

by:dexterrajesh
ID: 36522138
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
 
LVL 12

Author Closing Comment

by:jazzIIIlove
ID: 36522150
Thanks angellll
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now