Click here to Skip to main content
15,887,332 members
Home / Discussions / C#
   

C#

 
GeneralRe: Code style Pin
Lutosław28-Jun-11 1:03
Lutosław28-Jun-11 1:03 
AnswerRe: Code style PinPopular
Keith Barrow28-Jun-11 0:23
professionalKeith Barrow28-Jun-11 0:23 
GeneralRe: Code style Pin
Pete O'Hanlon28-Jun-11 0:34
mvePete O'Hanlon28-Jun-11 0:34 
GeneralRe: Code style Pin
Lutosław28-Jun-11 0:45
Lutosław28-Jun-11 0:45 
GeneralRe: Code style Pin
Keith Barrow28-Jun-11 1:22
professionalKeith Barrow28-Jun-11 1:22 
GeneralRe: Code style Pin
Lutosław28-Jun-11 1:50
Lutosław28-Jun-11 1:50 
GeneralRe: Code style Pin
Keith Barrow28-Jun-11 1:57
professionalKeith Barrow28-Jun-11 1:57 
GeneralRe: Code style Pin
BobJanova28-Jun-11 3:45
BobJanova28-Jun-11 3:45 
If switch statements 'smell', then
if(thing == option1) ...
else if(thing == option2) ...

... also smells, and (unless it's a type for which switch is not supported in the language) it is worse than doing the switch explicitly because it's harder to see that that's what you're doing.

The rule of thumb is to do with duplication. If he's switching on this enum in several places, perhaps the class hierarchy should be adjusted so that it is not an enum, it is a class tree with a Render method (and methods for the other operations that are being switched on). There isn't really any evidence to suggest that that is the case in the original post, though, and it's somewhat outside the scope of the question that was asked.
GeneralRe: Code style Pin
Keith Barrow28-Jun-11 7:32
professionalKeith Barrow28-Jun-11 7:32 
GeneralRe: Code style Pin
BobJanova28-Jun-11 7:42
BobJanova28-Jun-11 7:42 
GeneralRe: Code style Pin
Pete O'Hanlon28-Jun-11 7:59
mvePete O'Hanlon28-Jun-11 7:59 
GeneralRe: Code style Pin
Lutosław28-Jun-11 8:08
Lutosław28-Jun-11 8:08 
NewsNOTE 3 ,4 Pin
Lutosław28-Jun-11 0:48
Lutosław28-Jun-11 0:48 
AnswerRe: Code style [modified] Pin
PIEBALDconsult28-Jun-11 3:09
mvePIEBALDconsult28-Jun-11 3:09 
AnswerRe: Code style Pin
SledgeHammer0128-Jun-11 7:34
SledgeHammer0128-Jun-11 7:34 
GeneralRe: Code style Pin
Lutosław28-Jun-11 8:04
Lutosław28-Jun-11 8:04 
GeneralRe: Code style Pin
SledgeHammer0128-Jun-11 8:51
SledgeHammer0128-Jun-11 8:51 
GeneralRe: Code style Pin
Lutosław28-Jun-11 9:47
Lutosław28-Jun-11 9:47 
QuestionCreating a multidimensional array from class Pin
lada_vyvojar27-Jun-11 20:34
lada_vyvojar27-Jun-11 20:34 
AnswerRe: Creating a multidimensional array from class Pin
Mario Majčica27-Jun-11 23:29
professionalMario Majčica27-Jun-11 23:29 
QuestionRead from Byte Array Pin
DJ24527-Jun-11 20:04
DJ24527-Jun-11 20:04 
AnswerRe: Read from Byte Array Pin
Pete O'Hanlon27-Jun-11 21:49
mvePete O'Hanlon27-Jun-11 21:49 
AnswerRe: Read from Byte Array Pin
Mario Majčica27-Jun-11 23:31
professionalMario Majčica27-Jun-11 23:31 
AnswerRe: Read from Byte Array Pin
BobJanova27-Jun-11 23:52
BobJanova27-Jun-11 23:52 
GeneralBitConverter Endianness Pin
dybs28-Jun-11 12:56
dybs28-Jun-11 12:56 

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.