Want to build a tool to document papercuts. I think there's a lot of value to be had in documenting the small speedbumps you experience, at the time you experience them. Think the optimization path from "good" to "excellent" often lies in figuring out where the papercuts are.
Wrote down another one I ran into last week - Rust's `.unwrap_or()` methods: https://github.com/yoshuawuyts/papercuts/blob/master/2018-05-16-rust-or-else.md …
-
-
Also starting to doubt whether "papercuts" is the best term. Does it sound hostile? I don't mean for it to be hostile. Maybe "speedbumps" would be better? Or maybs "small-nuisances". The latter is a bit wordy though. Ghmmmm.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
`unwrap_or` can't return a Result because that wouldn't be unwrapped. it sounds like `or_else()?` might be a good fit though? `self.cache.get(key).or_else(|| self.db.get(key))?`
-
It's not because its always executed, which defeats the purpose. I cover both versions in the post - perhaps it wasn't being clear enough :/
- 10 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.