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 comes to the fore, and not 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 productive version, it shows a bunch of errors and shortcomings. We’ll figure out what a novice programmer needs to consider so that development is useful to the end user.
Step 1: Trust but Verify
Novice developers often implement “good” algorithms that work great with the “right” data. They do not pay attention to the behavior of the program when “incorrect” data comes in as initial information. Namely, this is usually the first thing that happens as soon as the program starts working in a productive environment.
It is difficult for the programmer to take into account absolutely all possible situations, but work in this direction is necessary. The algorithm should have checks in each block of code and generate messages for the user indicating warnings or errors in the data.
Step 2: Replace User
Another difficulty may be associated with users of the program. Any user, even with clear instructions for working with the program, can always press such a combination of buttons or enter data that will break the “good” algorithm if it does not have protection.
For these purposes, large projects often have testers or automated testing tools. The question is what to do if it is not.
It is actually not as difficult for the developer to imagine himself in the user’s place as it might seem. Users are human too and are capable of making mistakes. You need not to be too lazy and click on all the means of navigation, as well as enter incorrect data in all possible fields.
Step 3: Comment on the logic of the code when writing it
It is difficult to accustom yourself to write the program code and immediately explain its logic in the comments. An explanation is needed here: you do not need to decrypt each line and obvious things like initializing the values of variables, 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 subsequent support and modification of the application.
Step 4: Do Not Put Off For Later
Developers can create for themselves implicit problems when working on a multi-day task, when they deliberately skip minor blocks in the code. For example, advanced data checks before processing or logging where it is not necessary. This can subsequently interfere with dealing with emerging errors in the program.
Such things do not look too significant compared to other tasks. It seems that you can skip them and return to them later. The most difficult thing is to realize that then it may not come. After testing and fixing defects for improvements, there is often simply no time left. Do not skip or put off anything in the implementation of the algorithm, especially if it takes more than one day to work on it.
Step 5: Keep calm and rest
Often we find ourselves in a situation where time is running out: everyone has an emergency. The rush in development leads to the fact that the output program is able to run and perform some actions, but has serious failures in the structure.
In the best case, the code may contain a bunch of “garbage” left over from attempts to solve algorithmic problems. And at worst, a program may simply not be sufficiently debugged and tested to cope with the full range of business processes assigned to it.
This will necessarily lead to the need to often modify the program due to constantly occurring incidents in a productive environment. A sober assessment of one’s capabilities and a calm implementation are needed without panic and fear.