Well-organized code is especially important when working with class-based programming. Be sure to use comments to give visual structure to your document as well as to explain the code. Just as you organize lines of code into logical groups as functions, you should organize your classes into logical groups of methods and properties. If you find yourself scrolling through pages of code for a single class, this could be an indication that you should rethink your code organization. Look for ways to encapsulate the code into smaller classes that you can use together. |