Kludge It Till It Works

If it doesn't fit, buy a bigger hammer.

When in doubt, use brute force. - Ken Pittman


There's also:

When all else fails, use brute force. When brute force fails, you aren't using enough.


Or:

If it doesn't work, force it. If it breaks, then it obviously needed to be replaced anyway.


I once saw this in someone else's code:

 //Kludge it till it works...Grrrrr!

referring to the next section of code below. Sometimes when stuck, nothing else works and you just need a SpikeSolution, this mindset can at least get a first draft, which can be ReFactored later. Not that I am advocating kludges or lack of planning. But after trying all other DecisionRoutinesWhenStuck, KludgeItTillItWorks helps to start tame the problem. Just DoSomeThing instead of getting trapped by AnalysisParalysis.


I know the feeling. It is one of fighting a battle in a war that has already been lost.


It worked for biology, assuming you have a lot of patience. (GodIsQuickerThanEvolution)


I once contracted on a system where they tested against testing/staging sub-systems and production sub-systems in odd unpredictable phases. I couldn't predict what production part and test part they'd match up on any day, and they wanted it to self-detect its production state based on the ever-changing environment it was in, so the code I added eventually looked something like:

 // section X
 If <criteria> then  // adjust criteria accordingly
   x = production_version_of_this_section()
 else
   x = testing_version_of_this_section() 
 end if
 ...
 // section Y
 If <criteria> then  // adjust criteria accordingly
   y = production_version_of_this_section(x)
 else
   y = testing_version_of_this_section(x) 
 end if
 ...
 // section Z
 If <criteria> then  // adjust criteria accordingly
   z = production_version_of_this_section(y)
 else
   z = testing_version_of_this_section(y) 
 end if
 ...
 // section etc..
I feel sorry for the poor maintainer hired after I left. I felt bad about leaving such a mess, but did my best per circumstance. I would have lobbied for formal config flags, but the person I would be lobbying to had recently quit, and non-technical managers were all that were left.


CategoryStory


EditText of this page (last edited November 12, 2014) or FindPage with title or text search