liveBook · Manning

Maintainability

As explained in Troubleshooting Java, Second Edition

A maintainability problem is a condition in which software is harder to understand, modify, or support because of its structure or implementation.

A maintainability problem occurs when logging instructions make source code harder to read. Excessive log messages can crowd simple logic and obscure its behavior. section 4.2.3

Review logging for these warning signs:

  • Log statements interrupt the main logic instead of clarifying important behavior. section 4.2.3
  • A simple operation becomes difficult to follow because every step and intermediate value is logged. section 4.2.3

Extracting digits

A compact extractDigits method creates a result list, scans the input, keeps digit characters, and returns the result. A second version logs list creation, iteration, every character, matching characters, additions, and the final list. The extra instructions crowd the same logic and make it harder to read. section 4.2.3

Figure 4.15 Small details can cause big problems. Developers sometimes consider an app’s logging capability harmless by default and disregard the problems logging can introduce. Logging, however, like all the other software capabilities, deals with the data, and wrongly implemented, it can affect the app’s functionality and maintainability.

Use the figure to connect seemingly small logging choices with broader functionality and maintainability risks. section 4.2.3

How Troubleshooting Java, Second Edition covers it

How deep it goes
Contrasts concise and crowded implementations, but does not develop broader maintainability measurements or refactoring procedures.
Examples
Compares two Java extractDigits implementations, one concise and one crowded with per-step log messages.
What you can do after
Evaluate logging instructions for their effect on source-code readability.
How it connects
Connects logging with security, privacy, performance, and source-code readability.

Also explained in

Compare how 7 books explain maintainability →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java, Second Edition. The section links point to the parts of the book it draws on.