Google


   


You are here: CodeIdol.com > C++ > C++ Coding Standards: 101 Rules, Guidelines, and Best Practices > Avoid Magic Numbers

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

C++ Coding Standards: 101 Rules, Guidelines, and Best Practices



17. SummaryDiscussionExamplesReferences...



Programming isn't magic, so don't incant it: Avoid spelling literal constants like 42 or in code. They are not self-explanatory and complicate maintenance by adding...

read more: Summary


Names add information and introduce a single point of maintenance; raw numbers duplicated throughout a program are anonymous and a maintenance hassle. Constants should be...

read more: Discussion


Example 1: Important domain-specific constants at namespace level. const size_t PAGE_SIZE = 8192,...

read more: Examples


[Dewhurst03] §2 • [Kernighan99] §• [Stroustrup00] §4.8, §5.4...

read more: References

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

You are here: CodeIdol.com > C++ > C++ Coding Standards: 101 Rules, Guidelines, and Best Practices > Avoid Magic Numbers


ADBRITE ads links
   
Related tags







Popular Categories
Unix books and guides

AJAX popular information
C# language guides
Windows books and cookbooks

.......








Business Key Top Sites

be number one
rate your site


загран паспорт

    С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.

    Русский Polski Francais Deutsch
    support sitemap terms

© CodeIdol Labs, 2007 - 2009