|
|
|
|
|
by pron
312 days ago
|
|
> Hidden functions aren't a big deal in practice. Again, that's like me saying "forgetting defer isn't a big deal in practice." You seem to disagree with that and I disagree with your assertion. It's largely a matter of personal preference. And no, except for some compile-time tests/assertions and a smattering of lambdas, we don't use most of "modern C++" (or almost any of std). Sometimes we need to emit hand-crafted machine code, and sometimes we may need to mess around with stack frames directly (which means we can't use destructors in those cases. We do use destructors a fair bit, but I personally soured on RAII some ten years ago. |
|
It's the opposite, because for defer you need to be proactive and do it every time, but destructors are going to do the right thing and work, but if you question what's happening you can investigate.
One is happening automatically and already works, the other is manual and you always have to remember or your program is broken.
we don't use most of "modern C++"
You might want to try it out, it would probably help with all these misunderstandings.