Wednesday, January 19, 2011

How to use namespaces in C++ applications?

Typically you want to follow these good practice guidelines when developing a software application:

  • no more than 10-20 classes per package
  • no more than 1000 to 2000 lines of code per class
  • don't assign more than one responsibility to each class
If you go over one of these numbers then consider refactoring your application by creating a new package or a new class.

Note: The namespace in C++ is used as the package is used in java.

No comments:

Post a Comment