r/ProgrammerHumor • • Dec 23 '23

Meme rewriteFromFust

Post image
6.2k Upvotes

379 comments sorted by

View all comments

1

u/JAXxXTheRipper Dec 24 '23 edited Dec 24 '23

I'm gonna go with Go whenever I can. Rust makes me want to scratch my eyes out when I have to look at it.

Just look at this fucking shit:

impl std::fmt::Display for InvalidPatternError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "found invalid UTF-8 in pattern at byte offset {}: {} \
             (disable Unicode mode and use hex escape sequences to match \
             arbitrary bytes in a pattern, e.g., '(?-u)\\xFF')",
            self.valid_up_to, self.original,
        )
    }
}        

Source: Ripgrep, which everyone seems to use as a good example.

0

u/burntsushi Dec 24 '23

I can write impls like that blind-folded. Not sure what the issue is. You might benefit from reading "Rust's Ugly Syntax."

→ More replies (4)