Free Newsletters
Technology & Business Daily

InfoWorld
Log-in | Register
CTO CONNECTION  

Code jag in Vegas

Sometimes getting ugly is necessary, but be sure to document your quick fix

By Chad Dickerson  
June 21, 2005
 

About two years ago, a funny thing happened during a stay in Las Vegas. Up against great implementation odds, I got in touch with my inner hacker.

Free IT resource

Open Source Business Conference (OSBC) May 22-23, 2007

Sponsored by OSBC

Free IT resource

Virtualization Insights from Top Experts - Learn how virtualization gets real!

Sponsored by Dell

A business deal had closed, and when the terms were related to me, I knew I was in trouble. The deal essentially had to be implemented within a couple of days, and there was no packaged open source or commercial solution at the time to handle the problem at hand. Turnaround time was extremely short. I surveyed my IT staff. Quickly, I realized I was the only person with the immediate domain knowledge of the kind of systems we were dealing with. Given little time to train internal staff or to even find an outside consultant to take on the task, I had no option but to do it myself. And to make matters worse, I was off to Las Vegas for a conference I couldn’t skip.

When I landed in Vegas, I hurried past the airport slot machines and hopped a taxi to my hotel, where I checked in, drew the shades, and began feverishly writing code, thinking, “Just a short-term fix — we’ll write better code later.” Oddly enough, my code binge was fun. Don’t get me wrong, I would have rather been hanging out in casinos. But in some ways, Vegas is a coder’s paradise. Nighttime becomes a mere abstraction — the fluorescent glare of the Strip reminiscent of the harsh, artificial light developers know well from working in rooms lit only by CRTs. Although I’m not a gambler, I suspect that the thrill of a 3 a.m. winning streak at the poker table is not unlike a successful 3 a.m. build of code you’ve been working on for weeks. Holed up alone, facing high stakes, I broke almost every software development best practice you can imagine: I wrote the code, tested it myself, rolled it out, and opened my shades. Fortunately, the code worked and the immediate problem was solved — just not in an elegant way.

Fried, I surveyed my work. It was rather incoherent and not particularly well-structured — the angel of the thoughtful object-oriented approach on my right shoulder had clearly overwhelmed the sneering procedural devil demanding lots of obtuse wrapper scripts and heavy-handed root privileges on my left. My reasonable manager superego had been subsumed by a vicious hacker id eager for the immediate gratification of code running on a production system. But again, it worked. Fast-forward two years, and that code is still humming along, although we have started running up against scalability problems. Thankfully, the one best practice I didn’t skip over was the one that is most often omitted: documentation. I had carefully described my thinking and essentially drew a map that described in great detail where all the bodies were buried.

There are a few lessons to learn from my freewheeling code jag in Vegas. First, when managers like me are writing code, something has gone wrong in the communication process and must be corrected. In this instance, the time between the signing of the deal and the implementation was simply too short. Second, if you get stuck in a jam where you have to write “temporary” production code, it probably won’t be “temporary,” so the least you can do is document your feverish hacking well enough for the inevitable cleanup later on. Well-documented but inelegant code is superior to completely undocumented but structurally sound code. Finally, sometimes you must write ugly code to get a job done. But if you think what happens in Vegas stays in Vegas, you’ve never written production code there. I don’t recommend it.





 


 
Chad Dickerson is CTO of InfoWorld.

  More of Chad Dickerson's column
  Chad Dickerson's Weblog

Newsletter Get Chad's column delivered weekly.
Enter e-mail address:




 

TOP NEWS:


»  Antitrust review of Google-Yahoo deal no surprise
While serious antitrust problems are unlikely, both Google and Yahoo expected their partnership to be subjected to instense DOJ scrutiny

»  Top 10: Coreflood, more Microsoft-Yahoo, iPhone plans
This week's wrapup of the top tech news stories includes more Microsoft-Yahoo rumors, iPhone updates, Flash searches, Oracle's BEA roadmap, and more

»  Four 'important' Microsoft patches due Tuesday
Not rated "critical," fixes apply to "Elevation of Privileges" and "spoofing" bugs for Windows, Exchange, and SQL

»  Judge grants RIM a stay in Visto patent trial
Trial delayed from beginning next week while patent office studies validity of certain parts of e-mail provider Visto's patents as requested by RIM

»  Developers satisfied with Apple's enterprise work
Mac developers feel that Apple shouldn't try to make a broad attempt to win over enterprises and should instead focus on certain areas within the enterprise

»  Opera patches multiple bugs in flagship browser
Opera 9.5.1 fixes several flaws, including one ranked 'highly critical'




Are you ready for event-driven business?
"Faster than a speeding bullet" doesn't just refer to superheroes anymore, it's the velocity your business needs to compete. In this webcast you will learn strategies you can implement today that will keep your systems ahead of the increased business velocity. Sponsor: Progress Sonic

»  Click here to view this Webcast
  The Silver Lining: Cloud Computing
This IT Strategy Guide digs deep into cloud computing helping put you ahead of the curve on this hot topic. It explores the differences between cloud computing, grid computing and utility computing and then helps you see where and how each applies to your business. Sponsored by Box.net

»  Click here to download now

- Special Advertising Partners -
WHITE PAPERS
 

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
INFOWORLD MARKETPLACE
 
» BUY A LINK NOW
 

FIND PRODUCTS AND COMPANIES
» COMPLETE PRODUCT GUIDE



TECHNOLOGY INDEX
• Applications
• Application Development
• Security
• Networking
• Wireless
• Platforms
• Hardware
• Data Management
• Storage
• Web Services
• Business
• Telecom
• Professional Services
• Standards

TECH WATCH 


What's the 411 on GOOG-411?
Just as Google has become synonymous with "performing a Web search," 411 is understood to mean "information" -- as in "what's the 411?" I was thus surprised to discover, from a billboard, no less, that the king of search is taking on the ...

Apple HTML source reveals 'iPhone Extreme'
"This one's a stretch..." reports AppleInsider. Um, yeah. Reporting on HTML code sightings of product names could be called a stretch, but iPhone Extreme has a ring to it. Now, that sounds like the product Apple should have released first, rather ...

COLUMNISTS

Unified under law
Ephraim Schwartz's Column and Blog (InfoWorld) - In the litigious world we live in, deploying a unified communications platform in your enterprise could...
» MORE COLUMNISTS

MORE INFOWORLD BLOGS


Open Sources 
Product Management
When I joined MySQL four years ago, there was quite a lot of debate about product management. We didn't actually have ...

Zero Day 
Botnet herders tending smaller flocks
New research backs up the theory that botnet operators are keeping their networks smaller in a continued effort to keep ...



• Advice Line
• Database Underground
• The Deep End
• Enterprise Mac
• Geeks in Paradise
• Grid Meter
• The Gripe Line
• InfoWorld Daily
• Inside IT
• IT Troubleshooter
• ITXtreme
• Open Sources
• ProdBlog
• Real World SOA
• Reality Check
• Security Adviser
• SMB IT
• The Storage Network
• Tech Watch
• Virtualization Report
• Zero Day

ADVERTISEMENT


RESOURCE CENTERadvertisement 

GOVERNMENT IT & POLICY
'If you don't go after the network, you're never going to stop these guys. Never.'
From the State Department, All the News for Inquiring Minds
TechPresident, the Internet Citizenry's New Consensus Taker



Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS  CAREERS   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist