You'll have to pry my ability to do stupid shit from my cold dead handsääääääää
All Borrow Checkers Are Bastards (ABCAB - 12312)
6 days ago by ZILtoid1991 to c/programmer_humor
You'll have to pry my ability to do stupid shit from my cold dead handsääääääää
Garbage collection doesn't solve the problem either, cause it's too unpredictable and typically doesn't even give you the option to close resources when memory is reclaimed. So just opening SQL connections and forgetting to close them will quickly drain the connection pool.
It's not impossible, at least in C# I know you can mark objects that need to be RAII with some custom attribute and enforce correct usage patterns with a custom analyzer. You need to write it yourself but it's not impossible that way.
You can do some kind of RAII in python with the with keyword. Only works for local variables though, where it's easy to free resources manually
I mean, I really like the zig approach. It usually turns into “the caller is responsible for managing the memory”
But then when I’m the caller I sweat a little.
Police fans say the same thing about the police.
Yup. Although I like smart pointers due to their simplicity (unless it really needs performance), as well when dealing with tokio's spawn (eww. Smol and future combinators are way better)
Although trait bounds are always a bigger issue for me... probably because of my biblically accurate trait bounds
@programming.dev
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.
go to feed...
@programming.dev
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.
go to feed...
The whole point of it is to prevent you from doing stupid shit. Yes it's annoying. But you can't handle memory management on your own, no matter how much you think you can.
It's either that or garbage collection. Choose which one you hate less.
save