News for hackers. Stuff that matters.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by SomeRndName11 on Thursday July 13, 2023 @10:32AM (#36709757)
I think the way Go does error handling is the best compromise.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by the_gipsy on Thursday July 13, 2023 @12:04PM (#36711461)
It's a successful compromise, but probably not the best. It has a huge amount of little issues that simply aren't there with FP error handling.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by kaba0 on Thursday July 13, 2023 @04:04PM (#36715196)
Go’s solution is like people couldn’t decide on if they should turn left, or turn right to avoid the cliff, so to make everyone happy they drove straight into it.

It is literally the compiler enforced shitty error handling from C’s errno that is not even a sum type.

Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by vips7L on Thursday July 13, 2023 @05:34PM (#36716308)
It’s honestly the worst compromise. You can trivially ignore any error in Go and they don’t contain contextual information about the call stack.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by SomeRndName11 on Friday July 14, 2023 @04:32AM (#36721023)
ABility to ignore errors is a plus in fact. You can skip trivial non-critical problems and carry on without crashing the whole app, like it is normally done in C and C++.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by vips7L on Friday July 14, 2023 @11:30AM (#36725418)
It would be if you would have to explicitly opt into it via an ignored variable like _ or something. But currently with go you can accidentally ignore the error when you don't mean to.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by ziml77 on Thursday July 13, 2023 @06:50PM (#36717172)
It's one of the worst I've seen. It adds so much cognitive overhead to reading the code and makes it more annoying to write. Every function call that can fail is followed by 3 lines to check for and return the error. The actual logic quickly gets lost in there.

If it wasn't for the error handling, I would probably use Go for some of my projects. It compiles to a native, self-contained binary and still has the convenience of a garbage collector, and of course has plenty of libs available due to popularity.

Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever by SomeRndName11 on Friday July 14, 2023 @04:29AM (#36720997)
It does not have all that undpredictability of exceptions, and does not have nasty error handling logic of C. Do you know better alternative?