News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by Too on Tuesday November 26, 2024 @03:29PM (#42249711)
I think your conclusion is on the right track. Syntax sugar propagating results is in a way equivalent to exceptions. What you are missing it isn’t just equivalent to ordinary exceptions. It’s more equivalent to checked exceptions. A very powerful concept, that unfortunately got a bad rap, because the most widespread implementation of it (Java) was unreasonably verbose to use in practice. You might claim Rust is still too verbose and I don’t disagree with that, it’s a big improvement from Java at least, while at the same time providing even more safety nets.
Re:Lies we tell ourselves to keep using Golang by jll29 on Tuesday November 26, 2024 @06:14PM (#42251187)
Yes, Java is too verbose, but Kotlins cleaned up much of that boilerplate and runs on the same VM.

I'd be curious to see examples for where you think Rust is still to verbose.

Re:Lies we tell ourselves to keep using Golang by maleldil on Wednesday November 27, 2024 @10:52AM (#42256999)
You misunderstood. They meant that Java's checked exceptions are very verbose and that Rust's approach to errors is similar. While Rust's approach is less verbose, it's still more verbose than "regular" (unchecked exceptions).

Kotlin isn't relevant here because all exceptions are unchecked.