Click here to Skip to main content
13,899,965 members

C / C++ / MFC

 
GeneralRe: How can i shorten my array using enum? Pin
Arman S.28-May-08 21:28
memberArman S.28-May-08 21:28 
GeneralRe: How can i shorten my array using enum? Pin
SandipG 28-May-08 21:30
member SandipG 28-May-08 21:30 
GeneralRe: How can i shorten my array using enum? Pin
monsieur_jj28-May-08 21:36
membermonsieur_jj28-May-08 21:36 
GeneralRe: How can i shorten my array using enum? Pin
SandipG 28-May-08 21:46
member SandipG 28-May-08 21:46 
AnswerRe: How can i shorten my array using enum? Pin
_AnsHUMAN_ 28-May-08 21:29
group_AnsHUMAN_ 28-May-08 21:29 
AnswerRe: How can i shorten my array using enum? Pin
Rajesh R Subramanian28-May-08 22:03
professionalRajesh R Subramanian28-May-08 22:03 
AnswerRe: How can i shorten my array using enum? Pin
Nibu babu thomas28-May-08 22:29
memberNibu babu thomas28-May-08 22:29 
GeneralRe: How can i shorten my array using enum? [modified] Pin
Rajesh R Subramanian28-May-08 22:49
professionalRajesh R Subramanian28-May-08 22:49 
Nibu babu thomas wrote:
http://blogs.msdn.com/vcblog/archive/2008/04/30/enums-macros-unicode-and-token-pasting.aspx[^]


This is definitely not the best way of doing things. I don't see any good reason to employ such an ugly solution when using C++. My opinion is that such a technique might look 'cool', but it makes the codebase look horrible, adds unnecessary bloat and makes it difficult to maintain the code in the longer run. Macro substitution is an extremely blind technique; it never cares for semantics or scope in the code. Stroustrup's advise in his book was to avoid macros as much as possible, in fact not to use it at all. And the C++ committee suggests the same too. If there might be a situation where Macros are the only efficient way to do something, I haven't encountered one such situation.

Add: [No, I am not down-voting you, but neither am I going to vote you up in this case]


Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP

modified on Thursday, May 29, 2008 6:15 AM

AnswerRe: How can i shorten my array using enum? Pin
David Crow29-May-08 4:04
memberDavid Crow29-May-08 4:04 
GeneralRe: How can i shorten my array using enum? Pin
Rajkumar R29-May-08 19:50
memberRajkumar R29-May-08 19:50 
GeneralRe: How can i shorten my array using enum? Pin
David Crow30-May-08 4:10
memberDavid Crow30-May-08 4:10 
QuestionHow to know whether our application is focused or not? Pin
Super Hornet28-May-08 20:43
memberSuper Hornet28-May-08 20:43 
AnswerRe: How to know whether our application is focused or not? Pin
SandipG 28-May-08 21:18
member SandipG 28-May-08 21:18 
QuestionRe: How to know whether our application is focused or not? Pin
David Crow29-May-08 4:09
memberDavid Crow29-May-08 4:09 
QuestionHow to get URL of current web page by any method? Pin
sumit.durg28-May-08 20:30
membersumit.durg28-May-08 20:30 
AnswerRe: How to get URL of current web page by any method? Pin
Rajesh R Subramanian28-May-08 20:42
professionalRajesh R Subramanian28-May-08 20:42 
GeneralRe: How to get URL of current web page by any method? Pin
ShilpiP28-May-08 20:53
memberShilpiP28-May-08 20:53 
GeneralRe: How to get URL of current web page by any method? Pin
SandipG 28-May-08 21:11
member SandipG 28-May-08 21:11 
JokeRe: How to get URL of current web page by any method? Pin
_AnsHUMAN_ 28-May-08 22:10
group_AnsHUMAN_ 28-May-08 22:10 
QuestionHow to use SetFormat function of class CDateTimeCtrl properly Pin
varun0128-May-08 20:26
membervarun0128-May-08 20:26 
AnswerRe: How to use SetFormat function of class CDateTimeCtrl properly Pin
_AnsHUMAN_ 28-May-08 20:34
group_AnsHUMAN_ 28-May-08 20:34 
QuestionRe: How to use SetFormat function of class CDateTimeCtrl properly Pin
David Crow29-May-08 4:14
memberDavid Crow29-May-08 4:14 
QuestionDirect3D problem Pin
Ali Tavakol28-May-08 19:32
memberAli Tavakol28-May-08 19:32 
AnswerRe: Direct3D problem Pin
Rajkumar R29-May-08 2:47
memberRajkumar R29-May-08 2:47 
QuestionCRunTimeClass Error Pin
prithaa28-May-08 19:02
memberprithaa28-May-08 19:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190306.1 | Last Updated 22 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid