Two fisherman are fishing in a small lake sitting in a boat having a pleasant conversation while drinking beer and the following coversation ensues:
John: You brought your tacklebox right?
Bubba: Sure did.
John: Do you have a bass fishing lure?
Bubba: I believe so, here take a look.
John: Bubba...... that's not a tacklebox, that's a friggin bucket with a bunch of damn lures in it.
Bubba: You call it a bucket, I call it a tacklebox. Trust me the lure is in there
*John reaches in the bucket and starts moving lures around and immediately pulls is had out*
John: Ouch.. damn.... cut myself on a lure..... this is rediculous, how do you find anything in here?
Bubba: It takes a long time to find what I'm looking for, and the more lures I get the longer it takes to find something.
John: You need to get a real tackle box Bubba, this is just stupid that you call this organization let alone risk getting cut by rusty hooks everytime you reach in this bucket.
Bubba: Stop being a punk, you just have to move stuff around carefully.
*John reaches down to his side and lifts up a real tacklebox*
John: See how all of my lures are in nice neat compartments? I can find any lure I want in seconds, plus if I want to get rid of a certain kind of lure, I just dump all of them out of the drawer and put in the new ones. And, I makes sure that I have similar lures in each drawer.
Bubba: Uh huh......
As developers we have all had to work with the "Bubba Codebase".
It's that codebase that is infested with tight class coupling, god objects, crappy cohesion and no separation of concerns. As soon as you stick your hands in it you instantly start bleeding and spend hours looking for something. The reality is that if don't start your code by putting functionality in some cohesive compartments (small classes and functions), it is unlikely you will ever do it while working on the project.
Sometimes, your only option is to throw the bucket out and start over with new lures and a shiny industrial size tacklebox.
No comments:
Post a Comment