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

> Lifetimes completely confuse me, as it seems like they would be handled by garbage collection?

RAII approach (https://en.wikipedia.org/wiki/RAII) is more efficeint than garbage collection and also way better because of predictability. I'd say it's also more straightforward. Instead of some unpredictable and chaotic background magic going on, resources are deallocated right when they aren't needed anymore. I really don't see why would anyone prefer GC to it.



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

Search: