Solved

Magic numbering in C# programming.

Posted on 2011-09-12
3
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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