The rewriting trap…

I cannot count the number of times I have heard this phrase by a fellow developer “The component XYZ is an absolutely stinkin pile of %&^&*#, we need to rewrite the whole thing”. Actually I remember saying it once or twice myself. Probably in very rare cases this might hold true, but in most cases rewriting the whole thing would end being the wrong path to choose. It reminds me of the problem Netscape folks had faced a long long time ago…

When a component is developed, it has undergone many cycles of iterations, some demonstrations with clients. And needless to say, thousands of bugs that were reported over the period. (I say thousands because my current project JIRA count has crossed it way long ago.) So we have this old guy settled in its position for a long time and has grown many “things” around it so it looks hideous. But there is another word to explain this, matured! Rewriting this whole thing might make the code cleaner (which is a very subjective term anyways), but to get the component where it is not with clean code, that most probably would not be a trivial task. And not worth it too. As a proud member of the developer species, I do feel the yucky feeling when I see bad code smells all over the code base. But just dumping the whole thing and rewriting from scratch is almost never a wise option.

The only way to move in the right direction is Refactor. Before which, have strong unit tests for the component so that changing things around is a safe game.


Driving with Tests

I admit I am not a strict TDD developer. I write my logic first, and then move on to writing tests wherever I feel its applicable. It works for (at least until now), and looks right to me. This year I have put down an objective for myself to be a bit more strict in this area. I would want to start any feature implementation by writing its tests first and then get the code done, thus driving with tests. As a start, I did a small piece of functionality with this approach, and, I actually enjoyed it. I mean I enjoyed it so much that I was supposed to leave office early to get somewhere, I actually postponed it to complete my TDD approach. Sweet!(Umm that’s geeky, I know I know…) I had heard several experts saying that once you get onto the wagon of TDD, it would be the feel the most appropriate thing to do and would be hard to get off it.

I would suggest folks like me out there to give it a shot, make a task in your Outlook (or Lotus Notes, good bless you in that case!) to implement at least one teeny tiny feature with TDD approach. I think you would appreciate it. And if not, well… no one is stopping you from the Gung-Ho style Winking smile.

Happy Programming!


The next shiny thing

Warning : This post is more of self-criticism.

I have been a technical guy for a good part of my professional career, which is a good thing I think. I come across certain technologies at my work, I use them to solve problems. I also try to look out the window for more technologies that might help me get better at my work. This might involve a completely new technology (outside of the .NET world that I more accustomed to). Although I do get carried away sometimes with the next big thing. So I am working on WinForms Infragistics and creating some UI applications, next I realize there is HTML5, everything else is so not cool. So I have all kinds of HTML5 resources around me and I am excited. Then the REST web api catches my eye. Ah sweet, I need to get on that! And now I am scratching my head for how to solve problems using web api.

I think technology will come and go like it did until now. It is upon us to not get carried away by all kinds of things come up here and there. Sure, read about it, try to work out any useful things out of it, but be aware of the shiny trap. You should not end up being to know a 100 things and not 1 of them has been practically applied anywhere. This is a kind of addiction for sure, but stay focused by writing such posts every now and then Winking smile.


Getting back to reading

Yes, I know, I am a slacker. Its been a while I blogged. My bad, but I promise to improve on this (snicker…). I am getting back to my old habit of trying to read a new book every week. Its tough with a full time job in financial industry, but I think until we decide to get some things in routine, they would never be. This is what I am reading these days,

stevehtml5jquery

Not on iPad, not on iPhone, and any other “i” stuff. Its good old paper books. However smart and uber cool these tablets become, I am quoting this on the cloud, they can never be as good as having the actual book in hand and reading it. The crisp sound of the page turning, the smell of the page as you turn it, its just unique. I did not see the future, but I think books will always have their supreme place and always a bit above the machines.

Happy Reading!!!


Relax, that is the key…

When the going gets hard, the key is to relax. Its been tough times for everyone, the job market sucks, the economy sucks and then as always, the job sucks (Have I missed anything….). Anyways, the best thing to do when your mind is all going berserk is to STOP. Just take a chill pill. I visited Langkawi, Malaysia few days ago, absolutely soothing view right outside my hotel window,

 IMG_0889