Hacker News new | ask | show | jobs
by jzoch 1839 days ago
I've heard the same thing about C and why is C++ or Java necessary. Ultimately, I believe programming languages should strive to prevent mistakes early on in the lifecycle of a program. One easy way to do that in production software is to unify the control flow of happy-paths and error-paths (something go already does) and make sure that the error-path is acknowledged and not ignored (something it does not do).

The weakness in the current design is three-fold for me: - I can "forget" to handle in error (ok this can be linted for maybe?) - There is a lot of ceremony in propagating errors up the chain (a very very very common thing to do!) - The convention of (ok, err) is not always conformed to and ultimately provides no benefit over more concrete typings like Result<T, Err>. Now I can easily grep for fallible operations or operations that call fallible operations!

You may be fine with it - I hear the same argument from my coworkers about checked exceptions in java. I think we can do better.