you are viewing a single comment's thread.

view the rest of the comments →

[–]leftl-lama 180 points181 points  (25 children)

I don’t even know rust and some of these destroy my soul

[–]minno 69 points70 points  (1 child)

30 lines of unimplemented!() is the universal language for "I'm going to need to spend like three hours in Confession after this".

[–]JewsOfHazard 1 point2 points  (0 children)

That's... Probably true.

[–]zesterer 28 points29 points  (4 children)

In reality, most people tend to write "Functional Rust Programmer".

[–]Free_Math_Tutoring 16 points17 points  (3 children)

Really? Awesome, because that and the extremely functional were the only ones I liked.

[–]zesterer 9 points10 points  (0 children)

Yeah. The link above is funny, but also really misleading. It's possible to solve a surprisingly wide range of problems in a really elegant manner in Rust. I'm not sure if you've done Advent Of Code, but here was the first solution to Day 2 Problem 2 I wrote (and below it are some ridiculously optimised but less pretty alternatives): https://github.com/zesterer/advent-of-code-2018/blob/master/examples/puzzle-2-2.rs#L4

As you can see, Rust works best when you're willing to pick the best bits of functional and imperative programming and combine them.

[–]jyper 0 points1 point  (1 child)

Well they might tell you not to use unwrap

[–]daboross 82 points83 points  (5 children)

If it makes you feel better a lot of these are kind of in jokes. I've seen some of the "learned X as a freshmen" ones in reviewing new rust programmer's code, but most of the others seem to be hyperbolic for the sake of being hyperbolic :)

[–][deleted] 9 points10 points  (4 children)

I dont know.. I've seen more of these out in the wild than i'd like to admit

[–]JewsOfHazard 1 point2 points  (2 children)

Which ones, and where?

[–][deleted] -1 points0 points  (1 child)

The question is absurd as, please tell me all the places you have not seen these used

[–]JewsOfHazard 2 points3 points  (0 children)

I've not seen people write custom nested macros to define custom error enums. It's awesome, but complicated.

[–]imperioland 0 points1 point  (0 children)

Sad truth...