Tags » RAII

foonathan::blog() - How to handle errors in constructors without exceptions?

Sometimes you need to write code that can’t use exceptions. If that’s the case there isn’t an obvious way to handle errors in constructors, as they don’t have a return value. 29 more words


Reboot Early, and Often!

A wise man once said to me “Reboot early, and often!” He said it many times actually. When you’re trying to troubleshoot programs for which you don’t have the source code, you tend to develop little rituals that you go through to “fix” them… 297 more words


Garbage Collection Without a Garbage Collector | Toptal

Manual memory management is a nightmare that programmers have been inventing ways to avoid since the invention of the compiler. Programming languages with garbage collectors make life easier, but at the cost of performance. 43 more words


C++11 Completed RAII, Making Composition Easier

The addition of move semantics in C++11 is not just a performance and safety improvement. It’s also the feature that completed RAII. And as of C++11 I believe that RAII is absolutely necessary to make object composition easy in the language. 1,443 more words



In my application domain, the following shared object pattern occurs quite frequently:

Typically, Shared is a small, dynamically changing, in-memory, database and two or more threads need to perform asynchronous… 346 more words