Chapter 12. Next Steps

At this point, you know a lot more about what maintainable code is, why it is important, and how to apply the 10 guidelines in this book. But writing maintainable code is not something you learn from a book. You learn it by doing it! Therefore, here we will discuss simple advice on practicing the 10 guidelines for achieving maintainable software.

Turning the Guidelines into Practice

Ensuring that your code is easy to maintain depends on two behaviors in your daily routine: discipline and setting priorities. Discipline helps you to constantly keep improving your coding techniques, up to a point where any new code you write will already be maintainable. As for priorities, some of the presented guidelines can seem to contradict each other. It takes consideration on your side about which guideline has the most impact on the actual maintainability of your system. Be sure to take some time to deliberate and ask your team for their opinion.

Lower-Level (Unit) Guidelines Take Precedence Over Higher-Level (Component) Guidelines

Keep in mind that the aggregated higher-level guidelines are effects of the application applying the lower-level principles. For example, when units of code are long and duplicated throughout the system (see Chapters 2 and 4), the codebase will likely be large as well (see Chapter 9). This is because one of the causes of having a large codebase is that long units are being duplicated.

Therefore, when there is a conflict between two guidelines, adhering to the lower-level guidelines leads to better overall system maintainability. For instance, splitting units into multiple smaller units slightly grows the total codebase. But the advantage of small units in terms of reusability will have a huge pay-off when more functionality is added to the system.

The same applies to the architecture-level guidelines (see Chapters 7 and 8): it makes no sense to reorganize your code structure when it makes your components highly dependent on each other. To put it succinctly: fix your dependencies before trying to balance your components.

Remember That Every Commit Counts

The hardest part of applying the guidelines in this book may be keeping the discipline to apply them. It is tempting to violate the guidelines when a “quick fix” seems more efficient. To keep this discipline, follow the Boy Scout rule presented in Chapter 11.

The Boy Scout rule is especially effective on large codebases. Unless you have the time to sort out your whole system and improve maintainability, you will have to do it step-by-step while doing your regular work. This gradually improves maintainability and hones your refactoring skills. So, in the long run, you also have the skill to write highly maintainable software.

Development Process Best Practices Are Discussed in the Follow-Up Book

As discussed in the preface, the process part of developing high-quality software is discussed in detail in the follow-up book in this series: Building Software Teams. It provides 10 guidelines for managing and measuring the software development process. It focuses on how to measure and manage best practices for software development (e.g., development tool support, automation, standardization).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset