5 ms·
Alas, having no garbage collector at all is a blissful state of simplicity when performance matters. It's not very difficult to clean up one's objects manually
by wangchow 10y ago
Alas, having no garbage collector at all is a blissful state of simplicity when performance matters. It's not very difficult to clean up one's objects manually in a well-thought-out codebase.
- pjmlp 10y ago> well-thought-out codebase. Which in real life means a single developer ownership codebase.
- hood_syntax 10y agoOr a meticulous team of very high quality engineers with top notch documentation and design practices. Note that I do agree with you, however, because as you said: > in real life
- pjmlp 10y agoIn real life most companies don't want to pay for "meticulous team of very high quality engineers with top notch documentation and design practices". They rather pay for outsourced consultants that deliver something that works within a fixed price contract.
- wangchow 10y agoAnd most humans are lazy f%$#s who throw things away rather than recycling them.
- prodigal_erik 10y agoKnuth's code has bugs. NASA's code has bugs. There's no reason to believe that high quality software engineers even exist.
- gpderetta 10y agoHigh Quality != 0 bugs. (Small) teams of high quality engineers do exist, but are very expensive.
- tomp 10y agoExperience (i.e. the number of memory-related bugs) suggests otherwise.
- wangchow 10y agoWhat about smart pointers? It gives the flexibility and benefits of garbage-collection without the performance degradation. It's not a silver bullet but it helps. What I'm getting at is, Rust is the only modern language (in vogue at the moment) that does not use garbage collection. It would be nice if more languages didn't require a garbage collector but gave the option to use one. If there are some more of such languages please chime in and provide a link to them! :)
- tomp 10y ago> flexibility and benefits of garbage-collection Not really, as it doesn't allow/collect cycles. > without the performance degradation Only for single-threaded code. I agree with the rest of your comment!
- mike_hearn 10y agoD has optional GC. However in hindsight it is perhaps not so smart. The problem is that it fractures the ecosystem: some libraries require GC and others don't. If you don't want to use it you have to rely only on non-GC libraries.
- prodigal_erik 10y agoA smart pointer is just a way to add custom behavior when it's created and destroyed. The question is what the smart pointer does. Usually the answer is update a reference count, which happens so frequently that it ends up being a lot more expensive (especially in bus bandwidth) than occasionally tracing live objects between long periods of useful work.
- user5994461 10y agoSmart pointers are as hard to manage as pointers. There are different kind of smart pointers and you gotta think what you want to do with them. A GC is easier.
- gnaritas 10y ago> It's not very difficult to clean up one's objects manually in a well-thought-out codebase. Given the rarity of a well thought out codebase, I'd say it is. As soon as multiple people work on something confusion always ensues.