Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Garbage collectors don't solve the problem of "resource" management, but of memory management. Languages like Java have mechanisms such as try with resources (not available in Android) or try finally blocks which seem error prone to me, since the programmer has to know that that particular resource should be released explicitly. They also make developers lazy, they get used to not thinking about object lifetimes and the costs of allocation. YMMV of course.


Try with resources is available in Jellybean+




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: