| Zig has defer. And C has free, but you have to remember to use it and use it correctly every single time instead of the memory working by default with no intervention. Says most people in the field of software correctness Not true, the last 30 years have had much safer languages than before java, scripting languages, modern C++ and rust. That's true, but these are not memory safety guarantees. Pragmatically they mean you don't have to worry about bounds checking or memory deallocation and it stops being a problem. Zig doesn't have this and it doesn't have safety guarantees either. |
But even in a c++ destructer if you forget to dealloc a private heap allocation ... then you're in the same darn place.