Remove switch case fallthrough

IGotD- nise at nise.com
Thu May 13 13:55:10 UTC 2021


On Thursday, 13 May 2021 at 13:28:07 UTC, rempas wrote:
> Yeah yeah I know I know, Code that looks like C should have the 
> same behavior to C. I've asked about that and I got the same 
> answer. But come one! We can make an exception on this one! We 
> don't need that in D as we can add more cases.
>
> I really love the work the contributors do with D but IMO is 
> things like that who really stop D from REALLY going forward in 
> the next level. Doing things just for doing them NEVER helped 
> anyone!

In practice this is possible by just add another keyword. 
Something like "switch2", "switchb", can't really come up with 
good name. Then you just have a switch with break as default. 
What I have against it is that a new type of bugs will occur 
where the programmers accidentally mix up the two.


More information about the Digitalmars-d mailing list