Comment by wmu

9 years ago

It was comparison posted at HN -- exceptions were more efficient in case of deep stack unwinding, when compared to testing return codes. But of course, they are not totally free. RTTI memory footprint is negligible in practice; I work on a huge application, having thousands of classes. Nobody cares about the size of RTTI structures, it was never a problem. (Lack of standard API for RTTI is a pain in the neck -- GCC has nice non-standard solution, but MSVC has nothing.) I agree with you that overusing RTTI, like dynamic_cast, might be a sign of design flaw.

Speaking of printf, I meant its counterpart, like boost::format; it accepts format strings but is safe. It can throw an exception in case of an error, and a programmer can react accordingly.

I hate C++ streams, they're slow and cumbersome, one of the worst solution ever. I think lack of format string is their main problem.