switch()

Steven Schveighoffer schveiguy at yahoo.com
Tue Feb 18 06:56:19 PST 2014


On Mon, 17 Feb 2014 22:53:15 -0500, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 2/17/2014 6:17 PM, Steven Schveighoffer wrote:
>> How is this advantageous? It just seems annoying...
>
> Because it makes the programmer's intent clear - are all the cases  
> accounted for, or are there defaults?
>
> Of course, no compiler can make you write correct code. But if you're  
> going to write a default anyway, odds are you'll choose the right one.
>

I think your anecdotal experience with exception specification in Java is  
at odds with this expectation.

We all know programmers who are faced with seemingly annoyance hoops to  
jump through jump through them with the least possible effort.

-Steve


More information about the Digitalmars-d mailing list