Nov 29, 2009

The World of a crazy programmer

Have seen some real life fundo code and have been amazed at how this would be maintained.

It went something like this:
private static var oGlobalClassAObject = new GlobalClassAObject(new LocalClassB(olapDataClass,false),new URLLoader(new URLRequest("../local/assets/global/returnValidate.xml),false,new XMLList(result.result.data.children));

Needless to say, I was shocked, petrified, p***** off, on seeing this code. And the best part of this story was, a new "less Geeky" guy was asked to maintain this code. He read this code for the most part of the day and then called in sick for the rest of the week (my guess is he was attending interviews to escape out of this mayhem).

I would love to see a proper commented code explaining what each and every parameter of the above class constructor would lead to. A simple one liner would not hurt, would it? And if this API is tested as it is, the chances are, this object definition would end up in the automated test cases as well. So now the virus would spread from the development to quality to validation to customer.

"Always code as if, the person who would be reading it, is a psycho who knows where to catch you".

No comments: