Stupid and Dumb problems

Doh! by striatic from flickr.com

It seems there’s 2 different classes of problems that just drive me nutty, because it’s difficult to tell when I’m dealing with them.  Knowing the difference between them helps.  I call them stupid problems to solve and dumb problems to solve.  Consider a simple situation of trying to add 2 numbers.  Here’s a stupid solution:

function AddUp(int totalToAdd, int& originalValue)
     originalValue += totalToAdd

This could be called the “why bother” solution.  Here’s the dumb solution:

for(totalToAdd; totalToAdd > 0; totalToAdd--)
    totalSum -= 1;

Otherwise known as the “WTF” approach.

Now both of these are not good solutions, but the dumb solution is way worse.  It not only doesn’t solve the problem well, it makes every problem harder to deal with too, because it makes everything using it unreasonably slower.

So am I just saying don’t be dumb or stupid?  If only it was that easy.  But not every problem is this simple.  There are some genuinely hard problems out there.  And every once in a while I find myself working on something, and discover I’m actually trying to solve a dumb or stupid problem.  Stupid problems are easy to fix:  just ask someone else whose done it before.  But some problems are inherently dumb.  These problems are evil.  Think NP-complete problems.  These problems, by their very nature, will eat up your time and drag your project down.  They will seem right, but every solve you think of will bloat your schedule, or your CPU time, or something.  That’s a sign your problem could be a dumb one to solve.  But frequently, once I realize I’m tackling a dumb problem, all it takes to fix is to take a step back, say “This is a dumb problem, there has to be an easier way to achieve this.” I just change the question I’m answering to something easier, or cheat the output a bit.  Most of the time, I didn’t really need to be solving the dumb problem in the first place.

Yes,  I guess that means most dumb problems in development are stupid problems as well.  What can I say.

Advertisements

2 thoughts on “Stupid and Dumb problems

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s