3 ms·
You'd rather have bloated programs than some random not-necessarily connected bad-thing?
by igouy 7y ago
You'd rather have bloated programs than some random not-necessarily connected bad-thing?
- tombert 7y agoIt's not necessarily connected, but often connected. GCs introduce some level of bloat, but they also give stronger guarantees of memory safety. There are a lot more programmers out there now than there were 20 years ago, and with that we're going to inherently have more bad programmers writing bad programs. If they aren't good programmers, I don't trust them to handle memory correctly. I know languages like Rust and Swift have ways of safely dealing with memory without a GC, and I know Go has a non-blocking GC now, but remember that all of these things are relatively recent.
- kbenson 7y ago> I know languages like Rust and Swift have ways of safely dealing with memory without a GC Those are very different things, to my knowledge. Rust is "no-GC" in the vein of C and C++ (but the borrow checker makes the memory management portion easier to deal in that you generally don't have to manually free stuff). Swift is "memory managed" in that is uses reference counts to automatically check through the used variables and free ones that are no longer references. In my eyes, that's pretty clearly a type of garbage collection, even if it seems the term has become specific enough that it's less often applied to that case.
- tombert 7y agoThe Swift ARC is not a "full" GC; it does have a runtime effect, but a lot of the work is done at compile-time, and no need for a background process like Java's GC. That said, technically you are correct, it is a GC, just one with a lot lower overhead than something like Java/C#/JavaScript/Python.