> For the complete documentation index, see [llms.txt](https://gpcoder.gitbook.io/clean-code/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gpcoder.gitbook.io/clean-code/building-maintainable-software.md).

# Building Maintainable Software

- [Write Short Units of Code](https://gpcoder.gitbook.io/clean-code/building-maintainable-software/write-short-units-of-code.md): Limit the length of code units to 15 lines of code. Do this by not writing units that are longer than 15 lines of code in the first place, or by splitting long units into multiple smaller units.
- [Write Simple Units of Code](https://gpcoder.gitbook.io/clean-code/building-maintainable-software/write-simple-units-of-code.md): Limit the number of branch points per unit to 4. Do this by splitting complex units into simpler ones and avoiding complex units altogether.
- [Write Code Once](https://gpcoder.gitbook.io/clean-code/building-maintainable-software/write-code-once.md): Do not copy code. Do this by writing reusable, generic code and/or calling existing methods instead.
- [Keep Unit Interfaces Small](https://gpcoder.gitbook.io/clean-code/building-maintainable-software/keep-unit-interfaces-small.md): Limit the number of parameters per unit to at most 4. Do this by extracting parameters into objects.
- [Write Clean Code](https://gpcoder.gitbook.io/clean-code/building-maintainable-software/write-clean-code.md): Writing clean code is what you must do in order to call yourself a professional.
- [Automate Tests](https://gpcoder.gitbook.io/clean-code/building-maintainable-software/automate-tests.md): Automate tests for your codebase. Do this by writing automated tests using a test framework. This improves maintainability because automated testing makes development predictable and less risky.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gpcoder.gitbook.io/clean-code/building-maintainable-software.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
