Clean code approach – values, principles and practices

Read this blog post to find out about the values, practices and principles on which software development using the clean code development approach is based.

Knowledge

Logical, understandable and comprehensible – or in a word: clean. This is how code should be designed according to the clean code development approach so that it is as easy to read, expand, change and maintain as possible. If these criteria are met, software of any kind can be produced efficiently and effectively.

In order to ensure even better code quality in a wide range of customer projects, Softway AG therefore places a very strong focus on clean code. To this end, in-house training courses are held at regular intervals to explain the background, values, principles and practices of clean code development.

In this blog post, we would therefore like to take a look at the four essential values for logical, understandable and comprehensible code and at the same time present frequently used practices and principles.

The foundation of the clean code approach

The foundation for clean code according to the clean code development approach consists of four values that developers should follow:

  • Changeability
  • Correctness
  • Production efficiency
  • Continuous improvement

Changeability

Software is very often used and developed over several years. The following applies: if it can be easily adapted to changing conditions, it is highly adaptable. However, software must be designed to be changeable from the outset. The later the topic of changeability becomes the focus of development, the more complex, expensive and difficult adaptations become.

Changeability can be increased through various design principles that influence the software architecture. These include the abstraction of information, the separation of responsibilities, the use of interfaces and the coupling of components.

Correctness

Software must be functionally correct. A spreadsheet must calculate correctly or an accounting program must post entries correctly. But non-functional requirements must also be met. For example, the developed program should use resources such as memory or processor time sparingly and response times should be within a defined range.

However, correctness also includes the correct handling of requirements. Only when it is 100 percent clear under which conditions and with which specifications a software is to be implemented can the process begin. If any points are still unclear, it is important to ask questions until all requirements are known.

Production efficiency

Ideally, the production of software of any kind should be particularly efficient. At the end of the software development process, the time and budget invested always play a role. If the development work is not done properly, the budget is quickly used up or the implementation takes significantly longer than previously estimated. Code that is difficult to read, change, expand or maintain increases the negative impact on the time and cost budget.

If, on the other hand, emphasis is placed on efficient production, this approach means that software can be further developed over years or even decades without having to start from scratch at a certain point. At the same time, high production efficiency reduces the susceptibility of the generated code to errors and has a positive impact on the time and cost budget.

At the same time, production efficiency serves to keep the other values presented here in proportion. On the one hand, in order not to increase the effort and correctness of software indefinitely and, on the other hand, to prevent gold plating (development of additional aspects that were not requested by the client) or overengineering (development of software with higher quality than required by the client).

Continuous improvement

The value “continuous improvement” serves to reflect on everything that has been implemented in the project so far. By recalling the way in which tasks have been completed, you can determine whether the processes carried out were particularly simple or rather difficult. This ensures that a continuous learning and improvement process is initiated. A particularly recommendable method in this context is regular retrospectives, in which what has been achieved so far is evaluated and, if necessary, improvements are suggested. It is also helpful to work with iterations. This refers to multiple repetitions of the same or similar processes in order to be able to assess where problems may occur or where processes work particularly well.

Weighting of the Clean Code Development values

Which value should developers pay attention to first?

There is no general answer to this question, as there is no fixed ranking. Basically, all four values presented form the foundation of the clean code development approach and are therefore at least equally important. Nevertheless, the topic of “changeability” addresses a basic attitude. Changeability means being open to future requirements and evolutions and thus describes the all-important adaptation of code to changing framework conditions. This makes changeability potentially the most important value in the foundation of clean code development.

Putting the four core values into practice

As a reader, you may be thinking: That’s all well and good, but how exactly do I implement these values in my daily work?

This is where the principles and practices mentioned at the beginning finally come into play. As the values presented are too abstract to ensure everyday implementation, building blocks have been developed that promote at least one of the values described. The principles and practices of clean code development.

Principles of clean code development

Principles are principles for structuring software. These principles generally complement each other and ideally the highest possible number of principles should always be observed. If the principles are not observed during the development of software, the associated effects will become apparent in the medium term at the latest or when the cost of adaptations increases. Whether principles have been adhered to or not can often be seen from the implemented code.

Two examples of important principles of clean code development:

  • DRY – Don’t Repeat Yourself: is designed to counteract the repetition of software patterns.
  • KISS – Keep It Simple and Stupid: Always find the simplest solution to a problem.

Clean code development practices

Practices are methods and techniques that are used continuously and describe what clean code developers implement in practice. This refers to fixed instructions for action, which often involve the use of tools. Unlike the principles, it is not possible to tell whether a particular practice has been implemented or not when implementing code. Two examples of practices:

  • Reflect daily: Reflection is the prerequisite for actively learning something.
  • Follow the scout rule: The Boy Scout rule states, “Always leave a place in a better condition than you found it.” Translated into the world of coding, this rule means that small things in the code should be improved and errors should be eliminated before they become major problems.

 

Information about the article
Reading time
ca. min
Created on
10.11.2022
Updated on
12.12.2025

Further topics and knowledge about SAP

Stay informed: with practical insights, helpful tips and relevant developments relating to Softway AG, SAP and our output management solutions.

consultation