Re:Rule of Zero (C++)
by Strilanc on Friday November 23, 2012 @11:16AM
(#4822658)
There's a similar rule of thumb in .Net with respect to managing native resources. Inlining the logic that handles the lifetime is much more bug prone than encapsulating that logic into a wrapper class (e.g. SafeHandle http://msdn.microsoft.com/en-us/library/system.runtime.inter... does this).
[ Parent
| on HN ]
I guess I'm lucky enough to never have seen that class in code I've seen. :)
That seems like typical Microsoft object-orientation. It's not really much of encapsulation. Reminds me of MFC :-/
Actually Microsoft started by developing a C++ library with lots of OO in the design.
However not everything went as they expected and people were also demanding something more light over Win16 and MFC was born.
http://computer-programming-forum.com/82-mfc/d13ea80282846f9...