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

To be fair, Googlers can't write modern C++ because they have a critical mass of legacy code that has never been exception-safe. Avoiding RAII kneecaps the whole language badly.


Google doesn't avoid RAII, they just avoid exceptions.


The beauty of RAII is that every resource is tied to the lifetime of an object, and every object is always in a usable state. Having to call extra open/close methods and check error codes breaks these invariants, and leads to objects with bad fidelity to the normal copy and move semantics the language is built on.




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

Search: