3 ms·
I feel like it's a bit grasping if you need such a complex example to debunk a straw man. Implicit garbage collection is about the ease of writing code, not re
by debacle 12y ago
I feel like it's a bit grasping if you need such a complex example to debunk a straw man.
Implicit garbage collection is about the ease of writing code, not reliability. You make the compiler work for you by not making what you want explicit. Yes, for bad programmers, this leads to better code, but that doesn't mean you don't benefit from implicit garbage collection if you are a good programmer.
- WhitneyLand 12y ago>>garbage collection is about the ease of writing code, not reliability No, it is about reliability. You are confusing not always necessary/perfect/optimal with average case reliability. On average, automatic memory management has less bugs because certain classes of mistakes can be entirely eliminated. Also this argument of good programmers don't have to rely on X as a crutch is more about pride than productivity. In the real world, most teams have code touched by developers at a variety of skill sets and everyone's contributions affect quality of code so tools should be measured across levels of expertise. If you look at the highly cited research on garbage collectors I believe you'll find most of it concurs as to the benefits, edge cases not withstanding.
- ijk 12y ago> Also this argument of good programmers don't have to rely on X as a crutch is more about pride than productivity. In the real world, most teams have code touched by developers at a variety of skill sets and everyone's contributions affect quality of code so tools should be measured across levels of expertise. Not to mention that sometimes even Homer nods. If something needs to happen in a certain way and you have to manually ensure that it happens every time, sooner or later even the best of us will slip up. Now, the tradeoff in power and flexibility might be worth the risk of shooting ourselves in the foot, but it's still a tradeoff.
- blub 12y agoMy experience with GC on Android is that it's nice when it works, but when you have to optimize you're screwed. I'd rather have a system like in Swift where the destruction of objects is deterministic. deinit can take care of releasing resources in time. C++ offers the most flexibility, and using containers and smart pointers makes code that doesn't care much about memory look quite decent too. I have to admit that Swift makes it a breeze though, you don't have as much overhead in thinking about memory management.
- debacle 12y agoWhile I don't have the same experience as you do on Android, I agree with your sentiment completely. When GC gets in the way, it should be easy to turn the GC off and fly solo. Some languages provide that functionality, others (Java) don't.
- maxlybbert 12y agoI didn't consider it a complex example. Instead, it was a set of examples, each focused on one argument regarding garbage collection.