During my professional development, I worked as Researcher, Professor, Principal Analyst for Technical Support, and Software Architect.
I had forgotten what a wonderful thing is to write computer code just for fun, as I did at the very beginning of my life, before my PhD.
As computer programming is one of the most beautiful jobs that I have done in my whole life, I joined to the online practices at HackerRank.
I understand that most programmers develop computer software as their way of living. Anyway, I have the following concerns:
- Some colleagues are writing highly complex code, that includes unnecessary function calls, to develop the solution of a simple problem.
- Some solutions didn't validate the input data.
My question is: Why?
Programming languages have evolved enough in order to provide many tools that help improving the quality of the code. Even more: many frameworks have been built, allowing to reduce the time of development.
However, I believe that programming is still an Art..., and the programmer must still being in control of a huge amount of details.
There are four programming rules that it seems some developers have forgotten, and I believe that these should be rescued:
- Avoid unnecessary code. Keep it as simple as possible. If the code is growing, it could be useful to divide it on manageable modules. Notice that this issue could appear even if you are writing software by using Object Oriented programming.
- Validate the inputs.
- Initialize all your variables. Do not trust that the compilers will do that for you.
- Comment the code in a descriptive, and useful way.