A programmer writes little, but reads a lot

A programmer writes little, but reads a lot

Hello, my name is Oleksandr, I am a backend developer. The purpose of this post is to analyze the time spent on application development. Calculations are based on Python web applications. Also, the situation of developing an MVP for obtaining various tenders is not considered. As a simplification, the words “developer” and “programmer” are used interchangeably in this publication.

Most often, many people who are not familiar with the features of software development may have the impression that more than 90% of the time should be spent writing software code. Many novice programmers feel that the quality of their work is directly proportional to the amount of code they write. But is it so?

Let’s estimate how many code characters we write on average. To begin with, consider the average number of characters in a line of code (taking into account all indents). For this, 20 real projects implemented in the Python language on the following frameworks were considered: FastApi, Django, Pyramid. The results are shown in the table

min

max

average

Excludes empty lines

40

50

43

Including empty lines

34

42

36

For simplification, let’s take 40 characters in a line, i.e. approximately 10 words (4 characters per word).

And how many lines of code do we write per day? In work [1] it is noted that we write an average of 10-12 lines. And at work [2] it is indicated that a programmer writes 100-150 lines of code per day. That is, even if we take 100 lines of code per day, we will get an average of 4000 characters or about 1000 words, which seems not much. But really, if you look at Merge requests, they will often be small (tens of lines of code). Of course, there are exceptions. When developing new functionality, large volumes of code are added, Merge requests for hundreds of lines. But before that comes the stage of studying the problem, choosing a method of implementation, and after fixing bugs and finalizing new features. In which the code base increases very little. For comparison in the article [3] an average typing speed of 50 words per minute is given, which is 24,000 words per day. Which is much more.

Undoubtedly, the speed of development of a software product is a very important parameter. Probably one of the most important from a business point of view. But this speed is characterized by the size of the work performed (new functionality and fixed bugs), and not the speed of the growth of the code base. Therefore, the question may arise: what does a programmer do?

The answer is simple – he thinks and reads, reads and analyzes. And what exactly is he reading:

  • documentation of the entire project to understand what it is developing;

  • legacy code – after all, we are not always involved in a completely new project;

  • our own code – when finalizing new features, when fixing bugs, when refactoring, we must first read and understand what was written earlier. In this connection, the quote by M. Fowler is mentioned: “Any fool can write code that will be understandable to computers. Good programmers write code that people can understand”;

  • automatic tests – which in some cases can supplement or replace documentation.

  • documentation, new capabilities of libraries and frameworks. Because their constant development takes place, and the architectural and technical solutions relevant before may not be the most optimal today;

  • and, of course, books and articles to expand your horizons and understand IT development trends. Search for new, more optimal technical solutions for the project.

It is the analysis of everything read that allows you to write high-quality software code. Which is convenient to maintain and develop in the future. Do not neglect quality for quantity. This threatens the appearance of various errors related to the choice of wrong approaches and technologies. And if you remember R. Martin’s “Clean Code” to fix such errors, it can waste a lot of time. In the same way, ill-considered technical decisions can initially allow the initial functionality to be quickly implemented, but completely block further product development.

Programming is a specific job. This is a very intense intellectual activity that is not limited to the working day. Programmers are characterized by a desire for constant self-development and learning new things. That is why the most important work is done just away from the keyboard.

Related posts