From my archives, 2016/03/05:
Today’s introspection will focus on my approach to programming. I should note that I’ve only been working at a software job for about half a year, so a lot of this will undoubtedly change. In fact, at my level of experience, change is necessary.
I have unfortunately had to write code very hastily in response to tight time constraints. This has resulted in code that is challenging to maintain and difficult to adapt to particular needs.
I will try my best to do the following from this point forward:
Firstly, I will conceptualize and outline my coding projects, starting from desired input and desired output and filling in required blocks. Each block will then be analyzed to see if those need to be broken down into still more blocks. This has been challenging before; since I didn’t have a lot of practice with scripting before (particularly in Python), I had a very tenuous grasp of what’s possible, what’s expected due to established conventions, and what kinds of code architecture is the easiest to follow. Now that I have some degree of practice under my belt, I believe that I’m at a stage where I can reasonably create decent programming outlines.
Secondly, I will properly modularize my code. Each plotting event will have its own method or function, each repeated instance will have its own class, and I will have no more than 2 nested loops in any one code module. Modularity means that new functionality can be easily added or modified, and individual modules can even be called all by themselves if needed.
And finally, I will keep in mind the user experience. I should try to make the tools I develop to be easy to use. If possible, the user should not have to open up the script’s text file and make modifications to be able to reasonably use the script. Furthermore, the documentation and help files should make the purpose and usage of the script perfectly clear.