one year vs four days

May 12, 2012 at 1:47 pm | Posted in Programming | Leave a comment
Tags: , ,

At my workplace I contributed to the creation of a software while working with systems programming team. It worked fine at that time. Last year new requirements were proposed, which, from my perspective, pressed the need for a fundamental change in design. Face the fact, Corporates are rigid, hence ideas of changes in design were postponed, postponed and the postponed more. Its same story everywhere in every corporation (except few ones). Company decided not to take the risk of making new changes and added new code to the current product at that time. And that spoke trouble many months later and screams were heard followed by pressures and tensions in few months after those “many months”.

During last week I was assigned the task of rewriting one part of that software, as managers got too much frustrated with the rigidity. I was given the freedom of doing whatever I wanted to do make problems disappear in 2 days (I told them I don’t know black magic and none of my friends know Voodo). I looked at old design and new requirements and hell I did not see any match. So I rewrote several (yeah, not one) parts of that softwares, almost 80% of the code was rewritten, tested and given back in 3 days flat.

Whats so important in this ? The software which took one year to write, I rewrote 80% of code in 3 days, edited makefile and compiled the source and ran it and it did not segfault. Holy Cow… it was really black magic. Everything gave correct results while I tested it for 4th day. There was only one problem of a mutex lock was not opening. Whats the lesson ?

Experience, listening to experts in field and using methods, tools and techniques advised by those experts. No one is master in this world (especially no one becomes a master in 4 years) you have to share and learn from programmers around, provided those programmers really work hard on writing correct code. If you can’t find such programmers around you, google for usenet newsgroups, IRC channels, check comp.lang.(your language). Earlier when I contributed I was a newbie and now after 4 years I see I have developed the skill to solve problems in a fast and efficient manner. If I knew algorithms and data structures better than what I know now then I could have done much better job than 4 days or produced much more requirements-matching code. When a function is wrong then you can rewrite it. When a data-structure is wrong then you have to rewrite the data-structure and all the functions associated with it, which means 100% rewrite, which is what I did and I removed the rigidity of that software. It was pretty hard and the result was astounding.

Other lesson is to make sure your requirements are specific, not general. Instead of saying “We want to add/remove/find elements as efficient as possible”, one needs to ask “We want to add/remove/find elements based on a unique keyword.” Ask questions: Removals are more or additions ? “You want to sort the input or not and why ?”. “What exactly the input is and what exactly the output is, which requirements can match which data structure.” “Which operations are important and which are not.” “you want it to eat less memory or cpu and why” etc. etc.

This experience makes me both sad and happy. Happy because I can see specialized methods, tools and techniques of programming can save huge amounts of time. Sad because I am still far behind those methods. No wonder companies like Google/Microsoft/Facebook are ruling the world. They hire programmers who have mastered the art of these techniques/tools/methods. I still don’t know how to write a Red-Black tree using pointers. I still don’t know how to make it cpu-efficient or memory-efficient. Do we sort a red-black tree ? Saddest part is none of the interviews ask any questions of these type. All of the friends I know have never been asked any questions on algorithms/data-structures. Without them you can and will put lots of rigidity, headache in shipped code and build your future-tensions as inherent property of the software. When will you learn timesort ? (Tim Peters created timesort for use in Python Programming Language. go google immediately).

NOTE: As a business-owner/manager you must be thinking what is the business use of all these specialized techniques/methods and tools of programming ? Whats it in for me, Need I not make money ? I need to produce results as manager. Well, I am telling you since you are asking (or will ask): these are invaluable and useless, depending on your attitude. If you want your problems to be solved faster and better then use them. If you want to be better than your competitors then use them. If you don’t want to handicap yourself by solving same kind of problems for next 10 years but will really be happy to solve differet kind of business problems and make more money each year then please use them. And if you don’t want to accept that algorithms/data structures can help you then please don’t. Earth was always moving around Sun even when whole world believed it did not. I can’t help if you don’t want to listen to Joel Spolsky (I am writing in bold that he is a businessman) and Guy Steele and loads of others. In fact no one can help you then. (By the way, everyone knows Guy Steele)

 


Copyright © 2012 Arnuld Uttre, Village – Patti, P.O – Manakpur, Tehsil – Nangal, Distt. – Ropar, Punjab (INDIA)

Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.

Advertisements

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

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

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: