Juraj Malenica writes saying “You should develop boring code”. His post highlights the following:
- Make your code readable
- Keep your code predictable
- Your code is your documentation
If we take these as attributes of “boring code”, are these also attributes of “good code”? Let’s take a look.
Code readability (the ability to understand a source code function) is a good one. For most of my career, I have been working with existing code bases, and ability to understand what has been done before is very important. Working in the avionics industry, requirements and traceability go a long way towards helping understanding legacy software. If this is not available, avoiding the use of difficult-to-understand coding techniques can enhance readability.
In Juraj’s post, code predictability covers naming conventions for parameters/functions/files. For the projects I have worked on, coding standards help to define these conventions. Juraj mentioned a Python standard, there are many available.
Finally, code as documentation is a good goal. If there is no other project documentation, the source code should contain all the information necessary for another developer/engineer to pick up the code and add new features.
After this review, I would say these “boring” elements are also included in code that would be considered “good”. Is this everything needed? No (it is necessary, but not sufficent), but this is a good start.