DevX Home    Premier Club    Search    RFP Exchange    eLearning    Code Library    Help    Locator+    Shop DevX    
Join the Intel Knowledge Center on DevX.   Visit DevX Components and Tools Store
April 2000

 
EDITOR'S NOTE
 


Elden Nelson
Editor in Chief

I don't know whether to think of myself as a programmer, a derivative hack, a thief, or a genius in the tradition of Dr. Frankenstein.


    T   A L K   B A C K
Am I the only one that belongs to the Cut-and-Paste school of development? Tell me or join the Talk to the Editors discussion.


Beg? Borrow? Steal?

I recently finished writing an application for a client. It was just a little thing, but it does what it's supposed to do, runs fast, doesn't crash (not yet anyway), and I finished it on time. So I ought to be proud of it, right? Well, up until a few days ago, I was.

You see, I've had just enough time to let the project pretty much leak out of my head, and now the client has asked for some new features. (Sound familiar?) So I started reviewing the source (which, somehow, has transmogrified from the very soul of elegance into something bearing an uncanny resemblance to spaghetti). That's when it struck me: Out of 3000+ lines of code, I had written maybe 700 original lines for this project. Everything else I adapted from code I had previously written, borrowed from examples in books and magazines (including, you can bet, this one), downloaded from the Internet, or begged off a friend who had done something similar.

Thus began my instant identity crisis. "I'm not a programmer; I'm a lousy wannabe. I'm nothing but the development equivalent of a guy with a big roll of duct tape. I've been riffing off the same algorithms I wrote back in college." This led to an extended bout of depression, manifesting itself in the form of untold hours playing Quake III. Pathetic.

Now, though, I've calmed down a little and have started thinking about the way I program. I've decided (rationalized?) that there are some pretty compelling arguments for what I call "developing by sample," which, you have to admit, sounds a whole lot more professional than "Frankensteining."

Borrowing code saves time. Any time you can find a routine that does what you need it to, you've saved valuable hours. And I don't just mean you're saving the hours you'd have spent writing the code. Presuming you've lifted the code from a reliable source—www.vcdj.com, to take a random (hah!) example—you also save the time you'd have to spend testing.

There's some really good stuff out there. Chances are, if you're writing something that seems like it should have already been written, it probably has been, and you can locate it quickly on the Internet. Have you ever been to www.gnu.org? Sure, lots of it isn't directly portable to VC++, but let's face it: Converting it is faster than inventing it. You could do worse than spending a few minutes trolling around in www.vcdj.com, too. (Gee, another plug for our Web site. I wonder how that happened?) And there's tons more, all for the taking. Just make sure you give credit where credit is due.

If you borrow it, you've learned it. It's a rare function you'll find wrapped up with a nice little bow, ready to do exactly what you need. More likely, you'll have to walk through it, making at least nominal changes. By the time you're done, chances are you now could write it from scratch (or at least without looking quite as often). You're a better programmer than you were before. Go ask for a raise.

Of course, you need to look out for a few things when adapting code. One thing I notice, for example: I'll sometimes get myself started on a bizarre quest, spending much more time hunting down code than it would take to write it myself. (I'm very tenacious in my laziness.) Or, occasionally, I'll take the "black box" approach to existing code, trusting that it works, without knowing how. I've had that blow up in my face once or twice.

By and large, though, I think I've worked out my identity crisis. I'm still trying to decide whether I get to call myself a programmer, though, or if I should start looking for a new title ("Virtual Duct Tape Artist" has a nice ring to it). What do you think? Is massive code sampling real programming or the sign of a pretender? Let me know at vcdjedit@fawcette.com. C'mon, tell me. I can take it.

Sponsored Links
Click here for your FREE Unbreakable Security eKit.
Explore .NET functionality; take the New Worlds Challenge TODAY!
WIN One of Five BIG Prizes-Take the New Worlds .NET Challenge!
Download your FREE PentiumŪ 4 Processor White Paper! Register NOW for IntelŪ Developer Services.
A Developer's View of the Pentium 4 Processor Architecture

Join the Intel Knowledge Center on DevX.   Visit DevX Components and Tools Store

DevX Home | .NET Zone | Java Zone | Get Help
VB Zone | C++ Zone | XML Zone | Enterprise Zone | Database Dev Zone
Wireless Zone| Security Zone | ASP Zone | DHTML Zone | UML Zone
MarketPlace | RFP Exchange | Discussions | Newsletters | Tech Tips | Sourcebank
Advertise | Help | Copyright | Privacy Statement