Solved

Magic numbering in C# programming.

Posted on 2011-09-12
3
385 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
Comment Utility
0
 
LVL 9

Expert Comment

by:dexterrajesh
Comment Utility
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
Comment Utility
Thanks angellll
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

10 Experts available now in Live!

Get 1:1 Help Now