HN2new | past | comments | ask | show | jobs | submitlogin

I love destructors and RAII. They're more elegant than "with" constructs and much safer (unless you have a fancy type system that warns you when you create a resource object outside a "with.") They're the only thing about C++ that I really miss in other languages.


If anyone else who doesn't know C++ is curious about RAII (Resource Acquisition Is Initialization), the C2 wiki article was enlightening: http://c2.com/cgi/wiki?ResourceAcquisitionIsInitialization

Keep this in mind (from the wiki article):

    One problem with the name Resource Acquisition Is Initialization
    is that it is inaccurate: it's not always about resources, and
    it is nothing to do with initialization -- what makes the idiom
    tick is finalization.




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

Search: