That's why you should use JS
this post was submitted on 10 Jul 2023
21 points (78.4% liked)
Programmer Humor
32495 readers
553 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
fn main(){
let mut input = std::io::stdin().lines();
let num0 = input.next().unwrap().unwrap();
let num1 = input.next().unwrap().unwrap();
println!("{}", num0 + &num1);
}
Nothing makes me cringe more than seeing 4 unwraps in a row in Rust code. Like are you sure those errors will never happen? Do you really wanna panic?
And then I do it in my own code and I get it again. Rust error handling sucks ass. (I love Rust btw)
I unwrap like a mad man while building a proof of concept. It's the same as approaching say a multithreaded program. You always get the single thread to work first and then worry about adding thread handling later.
Same as result and option handling, that's for when I want to stabilise my code before finalising for release.