276
I love Rust (lemmy.blahaj.zone)
you are viewing a single comment's thread
view the rest of the comments
[-] PeriodicallyPedantic@lemmy.ca 2 points 1 day ago

I mean, if your IDE does it for you, is it really that much better that it's shorter?

[-] ReversalHatchery@beehaw.org -1 points 1 day ago

not the IDE, its the compiler. this is also not some AI shit, in many cases (not all) the compiler can actually figure out how to do this, because it's not hard, it would just be a lot of boilerplate if written manually.

[-] PeriodicallyPedantic@lemmy.ca 2 points 1 day ago

Why did you even bring up AI? IDEs have been able to generate equality functions for decades without AI.

It's kinda neat to have this defined directly in the language so that compilers can implement it, but creating equality function is so low effort that this doesn't really seem like a big deal.

Like, you define the members in a class, then you tell your IDE to generate getters, constructor, equals, hashcode, etc all in like 5 seconds.
I like it, it's nice when the language itself defines reasonable defaults for things, but realistically you're saving yourself a few seconds of effort.

[-] shy_mia@lemmy.blahaj.zone 7 points 1 day ago

Yeah but if the class changes you need to update everything, you got all that boilerplate taking up space for no real reason, etc...

The Rust way's just a lot cleaner imo.

[-] PeriodicallyPedantic@lemmy.ca 1 points 20 hours ago

It's like 5 seconds to regenerate it. Boilerplate doesn't matter, just collapse it. The only real issue is remembering to update it, if you make a change.

Like I said, I prefer for rust does it, it's just not a big deal

load more comments (4 replies)
load more comments (4 replies)
load more comments (4 replies)
this post was submitted on 15 Nov 2024
276 points (93.4% liked)

Programmer Humor

32476 readers
827 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS