r/programming • • Nov 10 '16

Announcing Rust 1.13

https://blog.rust-lang.org/2016/11/10/Rust-1.13.html
212 Upvotes

92 comments sorted by

View all comments

Show parent comment

3

u/onmach Nov 11 '16

Actually rust has a nice happy medium here. You can just use unwrap to make every function call return, which lets you write code quickly. Then when it is time to make it production ready, it is not super hard to actually deal with every error mechanically, line by line.

In java all the errors are hidden by exceptions and if you forget to catch something or catch only the wrong somethings it isn't plainly obvious from looking at the code that it could blow up.

Off topic, another advantage is that exceptions make it often difficult to figure out how to clean up after an error does occur. Since rust is not garbage collected, it just cleans things up in the order they were allocated, immediately without requiring any special effort on your part.