3 ms·
Unless you are very deep in system / embedded, most of the code that constitutes your program is not your code -- it's various libraries, frameworks, code gener
by crabbone 4y ago
Unless you are very deep in system / embedded, most of the code that constitutes your program is not your code -- it's various libraries, frameworks, code generated by utilities etc. Often times this is the source of both unsafe interfaces and misunderstanding of the functionality on the part of the developer writing the code.
Second to it is, probably, concurrency. RAII isn't going to save you here either.
Then there's also input processing where you may run into a situation that causes resources not being de-allocated because you never anticipated a particular shape of the input.
RAII works for very local and very well-defined things, it's not a good answer to dynamic situations or resources with complicated ownership.