Is there ANY chance we can fix the bitwise operator precedence rules?

Jonathan M Davis jmdavisProg at gmail.com
Mon Jun 21 21:27:07 PDT 2010


BCS wrote:

> Hello Jonathan,
> 
>> "goto case" does seem a bit silly, but I think that it's clearer and
>> less error prone for anyone who understands "goto case."
> 
> Say I have some code with a fall through. If I use the goto case X;
> version, it allows the cases to be freely reordered. OTOH if I use the
> other option, it doesn't. I think that the more likely error is for
> someone to rearrange my code and not notice that a case falls thought
> (with goto case; this causes a bug) rather than rearrange it and expect it
> to fall through where it doesn't (with goto case X; this causes a bug).
> For one thing, if you want it to fall thought, you are already thinking
> about that issue.
> 

It seems to be one of those things that definitely differs depending on how 
you think. At least we have both "goto case" and "goto case XXX," so if it 
becomes necessary to have a goto of some kind to fall through, we can pick 
which works best for how we think. If it becomes prevalent enough, it may or 
may not lead to a set of established ideas on the safest way to do it. At 
present, you have fallthrough, so most people probably don't use either form 
of goto.

- Jonathan M Davis


More information about the Digitalmars-d mailing list