There are 4 columns you have to keep in mind when you refactor your code. This list is in the order of priority you have to keep while refactoring your code.
- Readability
- modularity : How easy to reuse?
- Efficiency : How fast does your code run?
- Length : lowest priorty. If you ignore upper 3 items, putting the length on your first priority is bad. If shortening your code makes upper 3 better, then you can make your code length short