In development, every character counts

Gabor Csomak
2 min readJun 6, 2020

I’ve made a small research project. Basically i wanted to measure clean code. 100 high school graduates answer a ‘what is the output of the code’ kind of questions. Whenever we say code cleanness, we can’t measure. There are of course code smells, but no exact definition. That’s why its always asked on interviews. So lets see some key findings:

Two version of fizz/buzz. The average speed to answer is 131 vs 63 seconds.

As you can see on the images, the output is the same, but one is much clearer. But how important cleanness is? Lack of it can double the time to understand! Imagine a team of developers need half the time to understand the code! And its not some very out of world example, both solutions can easily be found in production codes. Not only the cleaner code halves the speed of understanding, but it also increased correctness. Lets look at another example:

Can you spot the difference? Correct answers were 68% vs 21%

In this example, finding the difference between the two code snippets is hard, and it doesn’t come natural. The difference is only a single character. Can you spot it? It’s on line 5. The exam takers didn’t notice either, therefore the right image had the success rate 3 times better! One character makes a difference of 68% or 21% understands your code. That is why clean code is important.

If you want to get updates on this research, don’t forget to subscribe!

--

--