O'Reilly Network    


 Published on The O'Reilly Network (http://www.oreillynet.com/)
 http://www.oreillynet.com/pub/wlg/3593

"Can't you just... ?" redux

by Andy Lester
Aug. 1, 2003

About a year ago, I wrote this in my use.perl.org journal:
I grate my teeth any time I hear a sentence that starts "Can't you just?" If those words come out of your mouth, stop and think. You're missing something important.

"Can't you just" is usually said when discussing a problem with someone else. The other person will explain the problem, and you'll jump in with the handy, simple and obvious answer. Some examples:

In each case, someone has a complex problem, with the not-very-helpful suggestion of an obvious, quick-win solution. The suggester has undoubtedly not taken all the issues into account. The response in each case will be one of the following:

It's rare that a complex problem has a simple solution, or that the simple solution doesn't have far-ranging side effects. Running an extension cable adds to the rat's nest of cabling in the server room, or the user flag will soon have to be a set of flags that become a maintenance headache, or the Linux server causes problems in an all-NT shop.

As programmers, we're used to doing magic and making things work right. As Perl programmers, especially, we are Lazy and Impatient, and expect the problem to be easily solved. However, if someone has been struggling with the problem for a while, the chances that they've missed an obvious, painless solution are small. It's also somewhat insulting to presume that the answer is right there in front of the person, unseen. Rephrase "Can't you just" as "Have you not noticed that the obvious solution is to", and you'll see what I mean. You're probably not that much better of a problem-solver than the other person.

There's nothing wrong with being helpful when colleagues are faced with a problem. Just keep the enthusiasm for your solution balanced with a healthy amount of skepticism, and expect that they're not blind.

Now, Piers Cawley has expanded his OSCON 2003 Lightning Talk into a thoughtful essay called "The Fine Art Of Complexity Management" where he argues that the word "just" is an excellent design tool. Read on as he discusses test-driven development, refactoring, Exegesis 6 and clarified butter.

Andy Lester is a QA & Release Manager for Socialtext. He is also in charge of PR for The Perl Foundation and maintains over 25 modules on CPAN.

oreillynet.com Copyright © 2006 O'Reilly Media, Inc.