News for hackers. Stuff that matters.
Re:Programming Affordances That Invite Mistakes by PaulKeeble on Sunday July 13, 2025 @04:21AM (#44548529)
Technically it doesn't because you can just ignore the error return and keep going anyway, its only a lint failure not to do something with a returned error. The language has a culture of dealing with the error straight away but the language doesn't enforce it.

In Java with checked exception you have no choice, you either try/catch it or you throw(s) it and are forced to handle it or its a compile error. Java does this aspect better, error handling features are relatively weak in Go but people have utilised the multiple returns well to make the best of it.

Re:Programming Affordances That Invite Mistakes by thaumasiotes on Sunday July 13, 2025 @04:32AM (#44548573)
> In Java with checked exception you have no choice, you either try/catch it or you throw(s) it and are forced to handle it or its a compile error. Java does this aspect better

You don't have to give any consideration to that if you don't want to; you can always just catch the exception and rethrow it as a RuntimeException.