Code natural selectionPosted: April 9, 2015
A funny thought just came to me: if you write nice clean code, it’s easy to replace it. Just plug out an object somewhere, replace it with another one implementing the same interface, run the tests. Tada! On the other hand, if you write crappy code it might be nigh impossible to replace it. It will probably be worked around whenever a change is needed, simply adding layers of crust. Maybe that’s why legacy code sucks: it’s simply code natural selection – and the fittest to survive is simply the crappiest one. I think I’m depressed now.