News for hackers. Stuff that matters.
Re:So We've Got a Memory Leak by mirsadm on Saturday May 11, 2024 @02:11PM (#40329697)
Any professional developer should understand these things. It was taught at first year of my computer science degree. As you say it isn't particularly difficult if you have a strategy. If you can't manage memory then what about any other resource that needs to be manually closed (sockets, file handles etc ).
Re:So We've Got a Memory Leak by da_chicken on Saturday May 11, 2024 @02:53PM (#40329919)
I'm not sure I understand the causal link between something having a proven track record of being error-prone and not understanding it.
Re:So We've Got a Memory Leak by prerok on Saturday May 11, 2024 @05:00PM (#40330604)
The problem is that automatic memory management means to some newcomers that you don't have to worry about it. Which is not true at all.

These newcomers may have heard about it, may even understand it at some level, but it's not in their rote knowledge. GC is great if you know that every allocation you do is expensive and that you know that it will be taken care of properly, because it will be short-lived.

But I have seen many cases where people just don't have it in their conciousness why allocating huge arrays is a problem or why allocating a new Character object for every single character in a string might be bad. As soon as I point it out, they get it, but it's not like they thought of it while writing their algorithm.