Posts Tagged ‘raii’

The meaning of RAII — or why you never need to worry about resource management again

Saturday, January 2nd, 2010

I tried really hard to come up with some witty title or pun to weave into the title of this post. I couldn’t. RAII is just a ter­ri­ble name, and it isn’t really clever or funny. Unfor­tu­nately, it is also the sin­gle most impor­tant key to C++. It is not just an idiom but a fun­da­men­tal phi­los­o­phy used to solve almost any prob­lem in the lan­guage. So we can’t really avoid it.

If I had to pin­point one thing that marked the dif­fer­ence between a skilled and an unskilled C++ pro­gram­mer, it would be “do they under­stand RAII”. Many peo­ple don’t, hence this post. (more…)