Skip to content

Dear future me… you’re so welcome!

May 9, 2012

Recently there has been a discussion on code and performance audit in linkedin. It is hilarious! If you can read Lithuanian I encourage you to do so, there are tons of golden quotes. They compare software development with moving bricks and producing chairs. (To be clear — I don’t call CRUD software development. As well as doing same thing over and over again. For me, software development is nothing else but problem solving with the right tools. If you’re repeating yourself non stop, that might be a problem. Solving that would be software development. Copy pasting code however is not.)

One particular quote sounds like this:

//Dear future me, you cannot imagine how sorry I am

Well, it’s a comment somewhere in the legacy code.

What scares me that this is accepted as “funny but true”. No I don’t mean that you should code perfect from the first time. Your views on design might change with experience. You might learn something new about your language. You might solve it with one code line instead of one hundred. You might think that the code smell is so intense that it gives you headache. But as long as you have that particular smelly part of code covered with tests you will thank your past self no matter how much the code sucks. Trust me on that.

I work with legacy system and I see copy-paste code everywhere. I see bad design decisions and endless methods. Single files of 5000 code lines that don’t seem to differ too much. There are singletons almost in every step. Nothing is dependent on abstractions and code is incredibly highly coupled.
But I can say this: if I take some time to put a piece of code under tests, even if it might make it uglier, since that moment, I thank and thank myself non stop. Even if the future me is only one week away, I know that guy will be happy as fuck when he finds that part of code under tests. Sometimes the guy is not even future me, it is present me and he is happy to work with that ugly piece of code that he didn’t even write!

I learn constantly and of course time to time I will come across some code that would make me think “What was I thinking?!”. But as long as it is well tested I will not blame that poor stupid old me.

Advertisements
2 Comments leave one →
  1. May 14, 2012 09:06

    Nice post and interesting discussion (fun nevertheless=). Thanks for letting know that’s not only me around myself who likes system testing:)

  2. August 31, 2012 18:51

    It is interesting discusion and it is true in development of all products, not only the code.
    Thank you for being open.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: