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

I understood malloc very well long before RAII made sense to me.

I think what made RAII seem like a good idea was seeing a large C code base at a major company which had a consistent approach to cleanup and error handling. It's very possible to write good code that way, but it takes manual effort, discipline, consistency. At that point I understood that RAII was about letting the compiler handle what I was already doing in C.



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

Search: