4 ms·
I think the rift comes from people thinking manual memory management is a bunch of random allocs and frees all over the place. That is gross and those of us wh
by mattpallissard 2y ago
I think the rift comes from people thinking manual memory management is a bunch of random allocs and frees all over the place. That is gross and those of us who don't mind managing memory don't like it either.
Personally my gripe is when people don't think about memory or space complexity at all. I don't care if it's a custom memory management strategy or GC'd language, you need to think about it. I have the same gripe about persistence, socket programming, and database queries.
Abstractions are great, use them, love them. But understanding what the hell they are doing under the hood not only improves efficiency, it prevents bugs, and gives you a really solid base when reasoning about unexpected behavior.
- danielledias204 2y agoBut for most developers using GC (Garbage Collected) languages, not understanding these concepts does not affect their ability to earn a salary and continue working.
- mirsadm 2y agoAny 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 ).
- da_chicken 2y agoI'm not sure I understand the causal link between something having a proven track record of being error-prone and not understanding it.
- prerok 2y agoThe 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.
- Dylan16807 2y agoIf the automatic allocation tools are good, then they're doing the same thing as quality manual management but with much more compiler enforcement.
- mattpallissard 2y agoNot exactly, GC is a general solution. Manual management can be tailor made. But to your point more compiler enforcement is a good thing.
- Dylan16807 2y agoI didn't mean just GC. Automated memory management comes in many forms and can be pretty specific. And it can be tailored too if a situation really deserves it. If I'm doing something custom I want the smallest amount of code to verify, just the special memory manager and not everything that uses it.
- mattpallissard 2y agoTrue, I misread your original reply.
- pjmlp 2y agoWhich is actually the case in enterprise source code, touched by hundreds of offshoring companies.