Re: switch statement - ANSI-C



Randy Howard wrote:
[snip]
I think your opinion on my advice is wrong. :-)

Keep in mind, the OP in question here was originally asking about how
to do a switch on string arguments. Someone that unfamiliar with the
basics of the language at this point is much better off getting
something working, then determining if it is in fact a bottleneck, or a
don't care to overall performance than trying to dive off into
something completely new to them when they have so much other ground to
cover at the same time.

I still think using a well documented library would be easier (even for
a beginner) than coding and debugging 100 if/else-if statements.

But I guess the whole thing is a tempest in a teapot and performance
won't matter either.

.



Relevant Pages

  • Replacing a switch
    ... which was much nicer (to my mind) ... switch ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Change Text to Memo
    ... Switch a given table field to Memo ... Function SwitchFieldType(sDb As String, sTableName As String, sFieldName ... Dim sSQL As String ... If Err.Number = 0 Then Exit Function ...
    (microsoft.public.access.modulesdaovba)
  • Re: proposal: reswitch
    ... > which levels of loops and/or switches and/or ... socket -server command ?-myaddr addr? ... You've got the quick-exit (break, no string), the fall-through to next ... -switch option), then it'd be the nth switch. ...
    (comp.lang.tcl)
  • Re: Large text file import: MVP question
    ... Simple solutions give fast processing ... One thing you have to keep in mind. ... througput time than from the basic Net namespace. ... change, with mid, split, tolower, or whatever will result in a new string. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: String-based Switch Request...
    ... Facilitate good callback programming design and modularization within GUI code ... When ever switch statements are used, they are typically over used being favour over polymorphism, which leads to brittle shoddy design. ... Use the string type-code as the Key and a Command or Strategy Object as the Value. ...
    (comp.lang.java.programmer)