Friday, June 22, 2012

Plain C with RAII idiom

One day I was pushed into situation that I must write in pure old-scool plain C. Nova days, modern C++ is sky-rocketing with Standards Comittee initiatives but cross-platform development is another world. So you have to forget templates, Boost and even STL. But most painful for me as "clean code" adept was RAII absence: no wrapper classes, no auto-generated cleanup in scope epilog etc... But with some trade-off in mind, you can get RAII then!