A running thing about Rust for me is that I get frustrated because I have about three times as much error handling code as I do in any other programming language but it's hard to complain because the fact of the matter is my Rust programs correctly handle errors at least three times as often as my non-Rust programs

I have talked about this before because it keeps happening

@mcc The rust compiler is a tough audience.

@darkling @mcc can't write any bugs if it's too hard to get your code to compile in the first place

[not serious, im a rust user :) ]

@mcc this never really bothered me too much but also I'm a sick freak who likes to do error handling as a treat
@mcc well, is that the language? or is it because you write more error handling code?
@mcc With enough .expect(), .unwrap(), .clone() it becomes a lot easier.
@mcc I am on the opposite side of this debate that I find myself thinking and handling a lot of failure conditions before even running / testing for the first time. I am not saying that this improves productivity but it definitely improves confidence in what you wrote.
@mcc this might be totally useless, or obvious, but I found it interesting, and maybe it’ll help… https://www.parsonsmatt.org/2017/10/11/type_safety_back_and_forth.html
Type Safety Back and Forth

Types are a powerful construct for improving program safety.Haskell has a few notable ways of handling potential failure, the most famous being the venerable...

@mcc so is it a good thing and you just have to get used to it? I suppose all programming languages are frustrating in some way or another.

@hyc i think i'm trying to distinguish friction due to poor design due to friction from the language actively making it difficult to be sloppy.

if you WANT to be sloppy in Rust, throw unwrap() everywhere. but Rust won't let you ignore how sloppy you're being, so over time you'll find yourself replacing those unwrap()s with principled error handling.

@mcc @hyc the fact that Rust does not paper over the fact that strings from the operating system are not guaranteed to be valid Unicode and thus forces you to deal with OsStr feels annoying but other languages just…pretend this situation does not exist?
@tedmielczarek @hyc since other languages don't have a way of getting a string that is provably utf-8, you kind of have to insert internal checks everywhere to make sure the data originating from within your own application is utf-8. which you won't. so you'll just have wrong behavior, eventually
@mcc and when your code hits an unexpected error in the wild you have a nice error chain that makes it easy to diagnose it, instead of an obscure crash
@mcc This is actually why I dont do rust. I mostly code quick hacky solutions that are supposed to be used once maybe twice. Rust is a perfect language if you are building something that isn't meant to be a massive house of cards that falls apart the second anything unexpected happens. But that's all I code these days so...
@TruelyNotARobot @mcc Yeah. I appreciate Rust's rigorous error detection but if I only need some ugly hacks I'd just go for some Python.