What is the hardest thing for a developer and what to do about it

developer

A novice developer often does not think about what the program is intended for and how it will be used in the future. For many, compliance with code quality standards is at the forefront, rather than how this code will be used in real life.

If the task manager is not experienced enough or does not have time to delve into business processes, a situation may arise when the program works correctly in test mode, and when switching to the production version shows a bunch of errors and shortcomings. Let’s figure out what a novice programmer needs to consider in order for the development to be useful for the end user.

Step 1: Trust but Verify

Novice developers often implement “good” algorithms that work great with “correct” data. They do not pay attention to the behavior of the program when “incorrect” data comes in as the initial information. That is, as a rule, the first thing that happens as soon as the program starts working in a productive environment.

Of course, it is difficult for a programmer to take into account absolutely all possible situations, but it is necessary to work in this direction. The algorithm should have checks in each block of code and generate messages for the user indicating warnings or data errors.

Step 2: Step into the user’s seat

Another difficulty can be associated with the users of the program. Any user, even with clear instructions on how to work with the program, can always press such a combination of buttons or enter such data that will break a “good” algorithm if it has no protection.

For these purposes, large projects often have testers or automated testing software. The question arises what to do if this is not the case.

It’s actually not as difficult for a developer to imagine himself as a user as it might seem. Users are human too and can make mistakes. It is necessary not to be lazy and click on all navigation tools in a row, as well as enter incorrect data in all possible fields.

Step 3: Comment out the logic of the code as you write it

It is difficult to train yourself to write program code and immediately explain its logic in the comments. A clarification is needed here: you do not need to decode each line and obvious things like initializing variable values, but the purpose of small blocks of code can be easily described with one line of text.

In most cases, one explanation will be enough for every 10–20 lines of code, this will greatly simplify the subsequent maintenance and modification of the application.