4 ms·
You're both right! Obviously manual memory management is very dangerous and straight up not for the average programmer. But if you look thorough GC code by gr
by biohacker42 17y ago
You're both right!
Obviously manual memory management is very dangerous and straight up not for the average programmer.
But if you look thorough GC code by great hackers. You'll notice a style that looks almost like free/malloc in that they take deliberate care to make life easy for the GC.
And on the other hand, programmers who are completely oblivious to how memory works, often write code which can confuse even the best GC so much that you essentially end up with a big memory leak. Strictly speaking the memory isn't leaking, the GC just can't quite dare clean it up.
The lesson is, even the best VM and GC won't make bad programmers into good ones.