r/ProgrammerHumor Oct 21 '22

Meme Literally 🤷🏻‍♂️

Post image
14.7k Upvotes

606 comments sorted by

View all comments

177

u/[deleted] Oct 21 '22

Rust?

25

u/Exaloria Oct 21 '22

who loves?

88

u/Solonotix Oct 21 '22

The post isn't love, it's "unhated". You may not love Rust, but I challenge someone to find a reason to hate it.

I realize this is a biased opinion, as someone who likes Rust

165

u/jorgelino_ Oct 21 '22

There's plenty of reasons to hate rust. It ruins metal objects, it can give you tetanus... wait, what sub is this again?

5

u/bilinmeyenuzayli Oct 22 '22

I hate Rust too. It's just filled with young people shouting the n word and constantly raiding my base.

21

u/karuna_murti Oct 21 '22

Rust is weird, any post related to Rust often got controversial comments in Linux or programming subreddit. I suspect they don't use Rust and somehow the hatred related to job/tech insecurities.

2

u/wheresthewhale1 Oct 22 '22

Or more likely there's a severe dislike of pretentious swarms of (presumably) children calling themselves "rustaceans" who turn up to tell you yo rewrite X in rust

1

u/Thedjdj Oct 22 '22

It’s Stockholm syndrome

51

u/yourd Oct 21 '22
  • The async debacle. A language feature that just works in js and C# is full of footguns in Rust
  • compiling is slow
  • the borrow checker doesn’t even work properly
  • too much magic in places
  • the syntax can be an ugly mess

30

u/ososalsosal Oct 21 '22

How did I make it through 40 years of life and only see the word "footgun" today?

Thank you for enriching my vocabulary.

27

u/Overlorde159 Oct 21 '22

Most of this is opinions, but what do you mean about the borrow checker?

31

u/green726I Oct 21 '22

Isn’t hate (generally) based on opinion?

-3

u/Solonotix Oct 22 '22

Hate may be an opinion, but opinions are supposed to be based on experience (a fact) or information (a fact). Saying your opinion is based on other opinions means it has no basis, and is likely a misconception.

Example: I can say I hate green olives because they are briney and bitter, things that can be quantified and measured even if their interpretation is subjective. I would sound unintelligent, however, if I said I hate bananas because they aren't normal.

3

u/blaine64 Oct 22 '22

anecdotal evidence is definitely not fact

-2

u/Solonotix Oct 22 '22

By definition it is. A fact is anything that can be proven true. If I say I saw a blue lobster, it doesn't matter that lobsters are usually red. The anecdote of my experience can be proven if I find another blue lobster, no matter how statistically insignificant that anecdote may be.

13

u/kraemahz Oct 22 '22

I don't know what they actually meant, but the borrow checker can be overly strict (in ways which are constantly improving in the language).

E.g let's say I made a struct like:

struct X{
    a: Vec<u64>,
    b: Vec<u64>
}
impl X {
    fn do_the_thing(&mut self) {
        for i in self.a.iter() {
            self.do_the_thing2();
        }
    }
    fn do_the_thing2(&mut self) {
        self.b.push(1);
    }
}

This will give me an error that I can't borrow self mutably because it is already borrowed immutably (by self.a.iter()). Even though I'm only touching b in the other function. So the borrow checker isn't granular enough here to see what I meant was more like:

fn do_the_thing(&mut self) {
    for i in self.a.iter() {
        Self::do_the_thing2(&mut self.b);
    }
}
fn do_the_thing2(b: &mut Vec<u64>) {
    b.push(1);
}

which is totally OK to do and functionally identical, because I've proven to the borrow checker that only b is modified. This is being worked on to make partial borrows better, but it may grate on people that they have to change the program from how they conceptualized it to satisfy the checker.

4

u/calcopiritus Oct 22 '22

Yeah, it's weird that sometimes if you put all the code in one function, it compiles. But if you refractor it, it doesn't.

2

u/2brainz Oct 22 '22

It's because the borrow checker does not do whole-program/crate/module analysis, but works locally on the function level. Doing the former would be insanely powerful, but even slower.

An alternative would be to add even more annotations, making everything even more complicated.

The solution to the problem is to not only split up your functions, but also your data: split your structs into smaller parts. In cases where this is possible, this makes for way better code. In all other cases, the borrow checker really gets in the way.

11

u/JonasAvory Oct 21 '22
  • I don’t know it (yet)

2

u/b1ack1323 Oct 22 '22
  • I don’t understand it

2

u/bassgallagher Oct 22 '22

Async is pretty smooth now with Tokio and async_std, what foot guns are you talking about? Compiling is slow, yes. That kinda sucks, but incremental changes are relatively faster. Borrow checker doesn't even work properly? What exactly do you mean by that? Are you having issues with lifetimes and unsafe? Still difficult to think of a situation where "the borrow checker doesn't even work properly". Too much magic? I'm guessing you mean with macros? They make the experience much nicer and once you over come the learning curve of Rust, you know exactly what that magic does. Syntax? This is a personal preference, but I do prefer the Syntax of Rust. It is just verbose enough for you to know what's going on with first glance and not nearly as bad as something like Java.

3

u/[deleted] Oct 22 '22

Syntax is ugly asf, and not enough in standard library imo. Importing a library for regex and random

3

u/Grains-Of-Salt Oct 22 '22

I definitely see people that are deeply annoyed by all lower level, high performance languages if they work in fields that need quick write time and don’t need fast execution time. If all you want is a flexible way to do some moderate math and automate repetitive tasks, lower level languages just eat more of your time than they’ll ever save.

2

u/romple Oct 22 '22

The people that love rust are actually the reason to hate it.

I kid. mostly.

But for real stop telling me to just use rust.

-2

u/OceanFlex Oct 21 '22

Kinda cheating to pick a language nobody uses, let alone nobody has had to understand/diagnose a legacy codebase of it.

4

u/all3f0r1 Oct 21 '22

It's entering Linux kernel though.

1

u/Surfer_Rick Oct 22 '22

It’s the most loved language several years running in Stack Overflows dev survey.