this post was submitted on 10 Nov 2024
195 points (95.3% liked)

Programmer Humor

32610 readers
11 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] bleistift2@sopuli.xyz 10 points 3 weeks ago (4 children)

If you cut yourself with a knife, it might be your fault. And it might be that the knife is sharp on both sides and has no handle.

[–] riodoro1@lemmy.world 8 points 3 weeks ago* (last edited 3 weeks ago) (3 children)

Posted on gigabytes of robust C/C++ codebase.

You cannot make a safe yet universal cutting tool. If it needs to cut, it can also cut the user. Its completely up to the user what he chooses to do with a knife and there have been many „accidents” with them. Yet we keep making and using simple knives in a form unchanged since before we could write.

[–] stetech@lemmy.world 4 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

You cannot make a safe yet universal cutting tool.

I’m neither language designer or crustacean advocate, but from what can be read, Rust seems to have managed just fine. The trick is probably to allow removing the cover of the sharp edge when needed (execute unsafe).

[–] lord_ryvan@ttrpg.network 2 points 4 days ago

Also, Rust allows "unsafe" code for when it's absolutely necessary; you DO need to add a line that basically says "I know compiler, don't stop me". To keep up the metaphor; Rust allows you to cut yourself with the knife, but ensures you're fully aware of what you're doing.

load more comments (1 replies)
load more comments (1 replies)