Clean Code Development: The values
The value system of Clean Code Development comprises the values of evolvability, correctness, production efficiency and continuous improvement.
Flow Design is a design method for software, which means that no object designs are known and only functional units are integrated. This is followed by implementation, in which the design is translated into a language (e.g. C#) using Flow Design.
Flow Design operates via data flow diagrams. Problems that arise are subdivided according to the divide and conquer principle and divided into sub-problems until simple functional units are created to solve them. Due to the graphical presentation, Flow Design offers an opportunity to design software together as a team and forces developers to formulate their ideas in the form of data flow drawings.
The functional units in flow design can be divided into two different tasks. In this case, the units can either execute logic or integrate several methods without, however, executing logic themselves. It should be noted that the functional units can only perform one of the two tasks at a time.
Logic is code that creates behavior. That is, code that brings about changes in states. For this purpose, the following constructs are used to define logic: Expressions, as they convert values from input to output values, API calls and control statements such as if-then-else, for, while, etc. Logic in the context of flow design is created through branches in the program flow, loops and value assignments.
Integration methods, on the other hand, simply call other methods that execute logic or integrate methods themselves. During integration, methods are called in a specific order and thus manage the data flow.
In the Coding Dojo, we edited a kata from the Clean Code Developer School. Function katas mean small tasks. The problem of katas is an algorithm, the solution in turn consists of a function. In addition, any refactorings must be considered (see Clean Code Developer School). The aim of the Coding Dojo is to observe and internalize the principles and practices of the CCD during development.
The specific task at our coding dojo was as follows:
Write a function that translates Roman numerals [1] into decimals.
examples:
“I” —> 1
“II” —> 2
“IV” —> 4
“V” —> 5
“IX” —> 9
“XLII” —> 42
“XCIX” —> 99
“MMXIII” —> 2013
The Roman numerals range from “I” to “MMM”.
Assume that the Roman numerals are correct.
At the beginning of the task, you have one or the other idea of how to approach this problem and which solutions need to be tackled. However, as a first step, you should ask yourself the following questions:
Flow Design is about modeling the solution to a problem itself and not about how it should be implemented technically. It is independent of a specific programming language, which is why no keywords or specific data types are used in the notation. If you consistently implement flow design and separate integration methods from operations, the IOSP (Integration Operation Segregation Principle) is automatically met.
What exactly was the challenge of setting the task? It is about converting Roman numerals into decimals. In the flow, we have declared the method “int fromRomanNumerals (string romanNumber)” for this. At this level, the problem resulted in the 3 points “Translating Roman numerals into decimal digits”, “Signing selected digits” and “summing the digits”, which were implemented in appropriate methods. As is usual in a team, disagreements and different solutions or ideas arise again and again. Therefore, where necessary, the methods were designed and discussed again in detail.
Flow design is a very good tool for a team to develop a common understanding of a problem and to derive tasks from it. These can then be processed in parallel by the team. By consistently implementing the IOSP principle, you have methods that are easy to test by design. In this way, the implementation can also be implemented according to TDD (Test Driven Development).
About the author:
Julian is a software developer specialized in web and .net technologies. In order to actually develop Clean Code, communication with the entire team is particularly important to him, in addition to purely technical decisions. Clean Code Development is a team sport for him and cannot be mastered alone.
The value system of Clean Code Development comprises the values of evolvability, correctness, production efficiency and continuous improvement.
Clean code development is divided into different grades, which you as a developer climb one by one and repeat in an eternal cycle
To become a Clean Code Developer, you need to internalize a number of virtues: Appreciate variation, only do the bare minimum, isolate aspects etc.
How to develop software that can be flexibly and adapted to new market and customer requirements in the long term