Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


What did you expect from a language that dictates to where to put your opening brace.


What? That's a common style choice, not a language requirement.


You can't put the opening brace of a block on a separate line in Go, because the parser will insert a semicolon before it.


Sorry - I thought the conversation was about Java.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: