this post was submitted on 06 Jul 2026
275 points (98.9% liked)

Programmer Humor

32158 readers
587 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] charokol@lemmy.world 71 points 15 hours ago (3 children)

I know nothing about rust but I assume borrow checker is some integral part of it that this guy somehow has never heard of?

[–] calcopiritus@lemmy.world 96 points 15 hours ago* (last edited 15 hours ago)

Yes. Someone that knows just a little more of rust than you do would know what the borrow checker is.

It's the core feature of rust.

Like talking about java and not knowing what "inheritance" is.

EDIT: just so you understand how vibecoded that project is.

The dude says he vibecoded "some of it" because some rust features make it a hard language for him. The one feature he's talking about is the borrow checker.

It's like saying "man, sure is hot today". Someone says "yeah, this summer sure is hot" and the dude replied "yeah, summerians lived in a hot place too".

[–] Limitless_screaming@kbin.earth 41 points 14 hours ago (1 children)

Very integral. When someone says they're "struggling with Rust", it's thanks to the borrow checker.

Rust's whole shtick is the way it manages memory, which is the rules enforced by the borrow checker.

Basically:

When you want to store values in variables in any programming language, the memory should be allocated when you need it and freed as soon as you don't anymore.

Traditionally there are two ways this is done:

  1. You manage it completely yourself, which is "unsafe" as you can forget to free memory you no longer need. This is called leaking memory. Or "reference" the location of something you freed previously, thereby attempting to read data you may not have permission to read (the OS will usually prevent that and kill the program), or reading and using a value you didn't expect, causing undefined behavior and fun to deal with bugs.

  2. The language, sometimes using a process which runs alongside your main program, manages memory. Which adds lots of overhead.

Rust has it's own way of doing this: It adds some rules on how you can pass around references and ownership and these rules are affected by whether you can or can't edit the referenced data. All just so the compiler knows the lifetime of the vars that hold that data and when it can free it (before the program is even compiled, so no overhead when the program is running). Not following the strict rules prevents your program from being compiled into an executable.

The compiler gives very helpful info, tips, and pointers™ though, Rust is also know for this.

[–] SalmiakDragon@feddit.nu 1 points 23 minutes ago

Thanks for the explanation!

[–] HuntressHimbo@lemmy.zip 10 points 14 hours ago

Some would call it the single biggest source of gotcha moments learning the language