Be kind to your future self — code clean!

Be kind to your future self — code clean!

6 years ago
Anonymous $oIHRkISgaL

https://medium.com/mickeysden/be-kind-to-your-future-self-code-clean-a03ef2649964

There is a story (a true one) I like to tell developers I work with. When I was doing my masters (a long time in a…you get it), I had taken a course on distributed computing, and we had a class project to build a Symmetrically Initiated Threshold Based Distributed Scheduling Algorithm. At the time, it was largest code base I had ever written from scratch. It was developed in C. I did well, and was proud of myself to be able to write and execute a distributed application where each piece would be independent and interact with other pieces, and had a central controller (the bottleneck and the single point of failure! But hey, that was then, and this is now!).

About a year later, my then roommate was taking the same class, and one fine evening when we were both in the lab minding our own work, he asked me to look over a section of the code he was working on, saying he was stuck. As I tried to recall how I had solved the problem at hand, I decided to pull out my old code (just a bunch of files in a folder — no SVN, no Git!!). I walked through and found the section in question, and then was literally staring my code for 10 mins when I said, “What the hell did I do here”. There was module that was about 20 lines of code, which I said I could do in 2–3 lines!