News for hackers. Stuff that matters.
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).
Re:Rule of Zero (C++) by Flow on Friday November 23, 2012 @11:30AM (#4822704)
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 :-/

Re:Rule of Zero (C++) by pjmlp on Friday November 23, 2012 @12:25PM (#4822930)
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...