Click here to Skip to main content
15,894,539 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is this good code practice? Pin
harold aptroot30-Apr-10 12:26
harold aptroot30-Apr-10 12:26 
GeneralRe: Is this good code practice? Pin
venomation30-Apr-10 12:49
venomation30-Apr-10 12:49 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult30-Apr-10 12:54
mvePIEBALDconsult30-Apr-10 12:54 
GeneralRe: Is this good code practice? Pin
harold aptroot30-Apr-10 12:58
harold aptroot30-Apr-10 12:58 
GeneralRe: Is this good code practice? Pin
venomation30-Apr-10 13:04
venomation30-Apr-10 13:04 
GeneralRe: Is this good code practice? Pin
harold aptroot30-Apr-10 13:29
harold aptroot30-Apr-10 13:29 
GeneralRe: Is this good code practice? Pin
venomation30-Apr-10 13:54
venomation30-Apr-10 13:54 
AnswerRe: Is this good code practice? Pin
AspDotNetDev30-Apr-10 14:39
protectorAspDotNetDev30-Apr-10 14:39 
If you need that logic in multiple places, there might be some value in putting it in a dictionary structure (e.g., if you need a combination of the values and the logic for selecting which keys depends on where the dictionary is used). That way, you can pass the dictionary around. Then again, you could just wrap a switch statement in a delegate and pass that around (may not work well if there is custom logic to access several keys). In this specific case, I see no reason a switch statement should not be used. It is certainly simpler and I recommend choosing the simpler approach unless there is a real chance you will need the more complex approach later.

AnswerRe: Is this good code practice? Pin
Abhinav S30-Apr-10 16:21
Abhinav S30-Apr-10 16:21 
AnswerRe: Is this good code practice? Pin
Som Shekhar30-Apr-10 19:41
Som Shekhar30-Apr-10 19:41 
AnswerRe: Is this good code practice? Pin
Pete O'Hanlon30-Apr-10 20:46
mvePete O'Hanlon30-Apr-10 20:46 
GeneralRe: Is this good code practice? Pin
venomation1-May-10 4:15
venomation1-May-10 4:15 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult1-May-10 5:41
mvePIEBALDconsult1-May-10 5:41 
GeneralRe: Is this good code practice? Pin
venomation1-May-10 7:18
venomation1-May-10 7:18 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult1-May-10 19:41
mvePIEBALDconsult1-May-10 19:41 
GeneralRe: Is this good code practice? [modified] Pin
venomation2-May-10 1:49
venomation2-May-10 1:49 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult2-May-10 4:07
mvePIEBALDconsult2-May-10 4:07 
GeneralRe: Is this good code practice? [modified] Pin
venomation2-May-10 5:58
venomation2-May-10 5:58 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult2-May-10 10:24
mvePIEBALDconsult2-May-10 10:24 
GeneralRe: Is this good code practice? Pin
venomation2-May-10 11:41
venomation2-May-10 11:41 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult2-May-10 17:44
mvePIEBALDconsult2-May-10 17:44 
AnswerRe: Is this good code practice? Pin
venomation3-May-10 0:56
venomation3-May-10 0:56 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult3-May-10 3:59
mvePIEBALDconsult3-May-10 3:59 
GeneralRe: Is this good code practice? Pin
Alaric_3-May-10 4:45
professionalAlaric_3-May-10 4:45 
GeneralRe: Is this good code practice? Pin
venomation3-May-10 5:04
venomation3-May-10 5:04 

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.