Click here to Skip to main content
15,909,324 members
Home / Discussions / C#
   

C#

 
GeneralRe: The Switch Statement Pin
Jammer13-Oct-08 8:43
Jammer13-Oct-08 8:43 
GeneralRe: The Switch Statement Pin
Mark Salsbery13-Oct-08 9:15
Mark Salsbery13-Oct-08 9:15 
GeneralRe: The Switch Statement Pin
Jammer13-Oct-08 9:18
Jammer13-Oct-08 9:18 
GeneralRe: The Switch Statement Pin
Mark Salsbery13-Oct-08 9:22
Mark Salsbery13-Oct-08 9:22 
GeneralRe: The Switch Statement Pin
Jammer13-Oct-08 9:26
Jammer13-Oct-08 9:26 
GeneralRe: The Switch Statement Pin
Vengatachalapathy Palanivel13-Oct-08 19:05
Vengatachalapathy Palanivel13-Oct-08 19:05 
GeneralRe: The Switch Statement Pin
Mark Salsbery13-Oct-08 20:23
Mark Salsbery13-Oct-08 20:23 
AnswerRe: The Switch Statement Pin
Wendelius13-Oct-08 8:41
mentorWendelius13-Oct-08 8:41 
Hmm, in my opinion why would it be incorrect to use a reserved keyword that's included in a language... Of course switch is much more limited compared to if-statement, but then again if used nicely it's really readable.

When reading long if-else-if-else... structures they easily take away the focus from the action that's executed if (simple) condition matches. Also in a multimatch situation, switch is very nice compared to or logic in if statements or duplicated code if or is not used.

However, is switch better than if in some case would greately be a matter of writing style (clarity above all Smile | :) ).

Mika

The need to optimize rises from a bad design.

My articles[^]

AnswerRe: The Switch Statement Pin
PIEBALDconsult13-Oct-08 8:44
mvePIEBALDconsult13-Oct-08 8:44 
GeneralRe: The Switch Statement Pin
Guffa13-Oct-08 11:42
Guffa13-Oct-08 11:42 
GeneralRe: The Switch Statement Pin
PIEBALDconsult13-Oct-08 16:04
mvePIEBALDconsult13-Oct-08 16:04 
AnswerRe: The Switch Statement - Quality Anyone? Pin
carbon_golem13-Oct-08 10:05
carbon_golem13-Oct-08 10:05 
GeneralRe: The Switch Statement - Quality Anyone? Pin
led mike13-Oct-08 10:08
led mike13-Oct-08 10:08 
GeneralRe: The Switch Statement - Quality Anyone? Pin
#realJSOP13-Oct-08 10:57
professional#realJSOP13-Oct-08 10:57 
AnswerRe: The Switch Statement [modified] Pin
led mike13-Oct-08 10:06
led mike13-Oct-08 10:06 
GeneralRe: The Switch Statement Pin
Mark Salsbery13-Oct-08 11:55
Mark Salsbery13-Oct-08 11:55 
GeneralRe: The Switch Statement Pin
led mike13-Oct-08 15:36
led mike13-Oct-08 15:36 
AnswerRe: The Switch Statement Pin
#realJSOP13-Oct-08 10:54
professional#realJSOP13-Oct-08 10:54 
GeneralRe: The Switch Statement Pin
Jammer13-Oct-08 11:01
Jammer13-Oct-08 11:01 
AnswerRe: The Switch Statement Pin
Guffa13-Oct-08 11:39
Guffa13-Oct-08 11:39 
AnswerRe: The Switch Statement Pin
Colin Angus Mackay13-Oct-08 12:05
Colin Angus Mackay13-Oct-08 12:05 
AnswerRe: The Switch Statement Pin
N a v a n e e t h13-Oct-08 16:07
N a v a n e e t h13-Oct-08 16:07 
QuestionThe GetDetailsOf() Method Pin
Ankit Rajpoot13-Oct-08 7:02
Ankit Rajpoot13-Oct-08 7:02 
AnswerRe: The GetDetailsOf() Method Pin
Dave Kreskowiak13-Oct-08 7:25
mveDave Kreskowiak13-Oct-08 7:25 
GeneralRe: The GetDetailsOf() Method Pin
Ankit Rajpoot13-Oct-08 7:30
Ankit Rajpoot13-Oct-08 7:30 

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.