Currently, my middle class contains about 500 lines of code and about 50 methods. The IDE is an Eclipse where I turned "Save Actions" so that the methods are sorted alphabetically, first with public methods, and then private methods. To find any specific method in the code, I use "Quick Outline". If necessary, the Hierarchy of Open Calls shows a sequence of methods that they call one by one.
This approach provides the following benefits:
- I can start introducing a new method without thinking where to put it in the code, because after saving it will be automatically placed by Eclipse in the appropriate place.
- I always find public methods at the top of the code (no need to look for the whole class for them)
However, there are some disadvantages:
When refactoring a large method into smaller ones, I am not very pleased that the new private methods are located in different parts of the code, and therefore it is a little difficult to implement the code concept. To avoid this, I call them in some strange way, to keep them next to each of them, for example: showPageFirst (), showPageSecond () instead of showFirstPage (), showSecondPage ().
Maybe there are some better approaches?
source
share