Re: Go ahead. Stop programming. This ensures you from any mistakes.



valentin tihomirov <V_tihomirov@xxxxxxx> wrote:
Right - and likewise, the only way it seems that you'll stop being
cross about things that C# stops you from doing is to stop using C#.

.. and invent my own language+OS and ... if aI do not like the decisions
made by men in power.

Yes, it's a silly idea - just like your suggestion of "Stop
programming" is, IMO. That was my point.

Well, I'm sure I'm not the only one who's been bitten by accidental
fallthrough in switch statements in C. As I said, I would prefer a more
radical overhaul of switch/case, but I'd rather have what we've got
than a version which has all the ugliness of the current version but
with the added problem of fallthrough.

If you were bitten for omitting a statement, it does not mean that this
statememt must be incorporated into the grammar.

It suggests that it wouldn't be a bad idea. I like ideas that mean I
make fewer mistakes, if they don't constrain me too much - and
disallowing fallthrough has hardly ever constrained me at all.

As Ben pointed out, you can always use goto case if you really want the
effect of fallthrough.

Would you like to have the effect to a series of your program statements by
emulating the "fallthrough" by explicit goto after every statement? As Bob
http://www.bobcongdon.net/blog/2003/12/c-switch-statement.html points it
out, C# designers should introduce a "safe" must-break-switch rather than
"improving" the switch by disallowing fall-through and then adding the goto
junk.

So then you really wouldn't be able to do what you want *at all*. How
is that better for you? If you don't like using the "goto" then just
don't - I know I don't.

I really don't care that much whether C# allows the use of "goto" or
not, given that I don't use it - but it seems odd to complain that the
language doesn't let you do something, and then complain that you can
do it but you don't happen to like the syntax.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: Go ahead. Stop programming. This ensures you from any mistakes.
    ... with the added problem of fallthrough. ... As Bob http://www.bobcongdon.net/blog/2003/12/c-switch-statement.html points it out, C# designers should introduce a "safe" must-break-switch rather than "improving" the switch by disallowing fall-through and then adding the goto junk. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: If you were inventing CoBOL...
    ... > made it up to compare with C, which requires an explicit exit ... Default fallthrough was a deliberate design decision by Dennis ... keyword for explicit fallthrough - unnecessary, since a normal C goto ... That is clearly an improvement in language safety, ...
    (comp.lang.cobol)
  • Re: Control cannot fall through from one case label (case 115:)
    ... fall-through or common typo bugs there. ... because you can't do a switch on a string wouldn't have been fun ... but the cases are themselves labels which you can jump to with goto. ... I think that the fallthrough concept is clearer than jumping to the ...
    (microsoft.public.dotnet.languages.csharp)
  • [PATCH 1/4] Char: rio, fix cirrus defines
    ... switch ) { ... "command blk %p\n", SubCmd.Addr, CmdBlkP); ... ** If the port is set to store or lock the parameters, ... goto close_end; ...
    (Linux-Kernel)
  • Re: function pointers
    ... The simple goto. ... fixed target label. ... The computed goto, aka switch, select, or caseof, depending ... In C it is the switch. ...
    (comp.lang.c)