Skip to main content
4 of 4
added 8 characters in body
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

This is where encapsulation pays off.

If you have functionality that's encapsulated in a method or class, that's written in the old MFC style, and you instantiate or call it using new-style code, it will still work, won't it? You don't ever have to look at that old code unless you need to maintain it.

Treat your old code like the black box that it's supposed to be, and you can have it both ways.


To be clear, I think you should leave your old code the way it is (it is tested and proven, after all), and write your new code using your new style. If everything is properly encapsulated, having two code styles in the same code base should not matter at all.

On a case-by-case basis, consider fixing the old-style code gradually so that it conforms to the new style guidelines. You can choose to do this when a class or method is in need of refactoring, or when you need to change its functionality.

Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683