Friday, April 6, 2012

Inheriting code and Software Organ Transplant rejection

http://en.wikipedia.org/wiki/Transplant_rejection

it's a well know fact that organ transplant can be very problematic, or fail, if donor and receiver have a different immune system - or something like that.

Same thing happens with code that you inherit from another developer leaving the project.

First reaction is "oh my God, what a pile of unreadable crap"



And off you go, plugging your nose and refactoring away everything, javadocking, commenting, eliminating those childish static methods (have you noticed that people who have no clue of OO programming make everything static? It's called procedural syndrome...)

The disgust towards the injected (organ) code is so huge that you can't even read the code until you haven't properly formatted it, inserted spaces (also, have you noticed that shell script monkey adore NOT putting spaces between operators and operands?), eliminated the tons of duplicated code, put hardcoded constants in a property file etc...

The brain rejects that crap, just like your body would reject an alien organism.

Immune system

That's why adhering to universal coding practices is so important.

No comments: