3 ms·
In Java, the compiler complains about unreachable code and aborts. I think that's ridiculous. Sometimes it's useful to create unreachable code during developmen
by quotemstr 9y ago
In Java, the compiler complains about unreachable code and aborts. I think that's ridiculous. Sometimes it's useful to create unreachable code during development.
int foo = doSomething();
return 0; // Debug XXX DONOTSUBMIT
int bar = doSomethingElse();
return foo + bar;
It's hilarious, though, that this workaround works:
int foo = doSomething();
if (1 > 0) return 0; // Debug XXX DONOTSUBMIT
int bar = doSomethingElse();
return foo + bar;
Go's mandatory warnings are equally annoying. I'm sick and tired of little rarefied groups of language designers trying to impose their ideas about best practices on the rest of the world.
- wruza 9y agoWhat did you expect from a language that dictates to where to put your opening brace.
- vkou 9y agoWhat? That's a common style choice, not a language requirement.
- ameliaquining 9y agoYou can't put the opening brace of a block on a separate line in Go, because the parser will insert a semicolon before it.
- vkou 9y agoSorry - I thought the conversation was about Java.