Solved

Magic numbering in C# programming.

Posted on 2011-09-12
3
389 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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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