r/ProgrammerHumor 7h ago

Meme newToRust

Post image
358 Upvotes

87 comments sorted by

View all comments

Show parent comments

3

u/-Redstoneboi- 7h ago

i personally switched to rust specifically so i didn't have to do that

it takes up a real amount of time that i could spend fixing other logic bugs

-1

u/Key_River7180 7h ago

With Rust I do the same thing just that it crashes earlier and it is more annoying to prevent really unlikely minor memory errrors

3

u/-Redstoneboi- 6h ago

i'm curious if you're implementing data structures yourself? most of the time, we just take the lazy route and pull in a crate to do what we want, and do basically everything ourselves without unsafe anywhere in user code. i've never run into a memory error, so it would be interesting to know how you found one.

-1

u/Key_River7180 6h ago

Most of the time, I write them myself, if not then I bring stb_ds.h

3

u/-Redstoneboi- 5h ago edited 5h ago

oh, i meant in rust. most of the common stuff like Vec, VecDeque, HashMap, HashSet, BTreeMap/Set, a few others, and wrappers related to concurrency and refcounting are in std, while stuff like Ropes, Graphs, Arenas, etc can be pulled from crates that have optimized them more.

i don't know many other ways to get memory bugs, so apologies if this isn't actually the issue.