On Tue, 18 Feb 2014 12:26:36 -0500, Daniel Murphy <yebbliesnos...@gmail.com> wrote:

"Steven Schveighoffer" wrote in message news:op.xbhkirppeav7ka@stevens-macbook-pro.local...

My point though, is that the change to require default gains you nothing except annoyed programmers. Why put it in?

It only gains you nothing if you respond to the error by mindlessly putting a default: break; in.


It may not be mindless. Most people who want to handle the default case do it. It's usually not so much "I didn't think of handling other values," it's more "I never expect other values to come in, go away annoying compiler error."

Here the right and wrong choice are about equal difficulty - trivial. I think complaints about typing those extra couple dozen keystrokes are on the same level as "why do I have to put these ';'s everywhere" and "'immutable' has too many letters".

I think it's the same as saying you have to always have an else clause after an if statement, even if it's "else {}"

-Steve

Reply via email to