About InfoWorld : Advertise : Subscribe : Contact Us : Awards : Events : Store
InfoWorld HomeNewsTest CenterOpinionsProduct GuideTechIndex
 
 

NEWS

 
Taking programming to the extreme edge

By Bruce Conrad, For InfoWorld Test Center
July 21, 2000


CONSIDER THE following scenario: Your company has decided to invest heavily in application development, so you've spent millions of dollars on hardware and software, mounted a huge recruitment effort, and created a comfortable work environment. All the ingredients for success are in place. Yet delivery deadlines are still slipping by, despite the fact that your developers are working 80-hour weeks. Your sophisticated project planning software said this wasn't supposed to happen. Unfortunately, it has happened.

   ADVERTISEMENT
  

Free IT resource

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

Sponsored by Dell

Free IT resource

TechNet: More ways to know it, share it, and keep it running.

Sponsored by Microsoft

RELATED LINKS
»  AT&T buys high-speed wireless spectrum for $2.5 billion
»  Update: Sprint chief Forsee resigns
»  IT trainer offers master's degree for hackers
»  Wireless RSS feed 

IDG ENTERPRISE NETWORK
More Network LAN/WAN News...  (ComputerWorld)
Wireless EV-DO on board  (ComputerWorld)

TOP NEWS 


IT SOLUTION SEARCH

Maybe it's time to go extreme. No, extreme programming, or XP, is not about nerds bungee jumping off bridges with laptops or geeks writing code while doing back flips on their skateboards. XP is simply a software development methodology -- with perhaps a bit of old-time religion and some New Age mantras thrown in for good measure.

Some of XP's main tenets are simple, commonsense ideas practiced to extremes. Keep it simple. Code in small iterations and work toward fast release cycles. Design as you go -- don't waste your time on a big up-front plan. Treat unit and functional testing as a crucial part of the project, not an optional add-on. Work directly with the customers and users, making them part of the programming team. Extend ownership of the project to everyone -- don't let people become isolated experts on portions of the code. Refactor (that is, rewrite and improve code) constantly. And remember, it's a jungle out there, so always program in pairs.

The buddy system

Pair programming is perhaps the most controversial aspect of the XP approach. Under this method, two programmers share the same workstation to write production code. The idea is to reduce the chances of writing poor code while also fostering a spirit of collaboration.

Granted, it may seem counterintuitive to think that two programmers working together could produce as much code as they could working apart. But to XPers, the fact that more developers understand the code compensates for the slightly longer development cycles. Although individual areas of expertise may be thinner, overlapping knowledge means you'll never again be held hostage by a sociopathic, albeit talented developer who's the only one that knows how a particular part of code works.

But is it really that easy? For all its promises of better code and departmental harmony, pair programming also spotlights XP at its most dogmatic. It is true that extremely good code (no pun intended) has been written by solo developers; many creative or competent people prefer to work alone. In a sense, XP is inflexible; it does not account for different personality types and work styles, and that may alienate important members of your staff (for more on pair programming, see our Test Center Analysis).

Apart from changing the way developers work, XP also changes the way projects are planned. Let's face it: Writing code is hard. Many software projects fail, sometimes because of bad management, sometimes because of bad coding, and sometimes because of a flawed initial concept or design.

XPers believe that if a project is doomed to fail, it's best to find out fast before you waste too much time and money. Instead of laboring over an all-encompassing design or object model and then sending your programmers off for six months (only to come back with an application that only a programmer could love), XPers code in small iterations and deliver the simplest code that could possibly work. There's no point in anticipating failures that may never arise or adding features that are never needed.

Hence, projects should be designed and developed in iterations lasting from one to three weeks. You can still sketch out long-range plans, but don't waste your time doing it in great detail. The idea is to maintain maximum flexibility in the design process. If you guess wrong in your design, you've wasted time or, even worse, locked yourself into a bad design. And even if you guess right, you could have come to the same conclusion later for the same cost. Similarly, don't design and code for reuse until it's clear that reuse is needed.

Some might argue that if your design is changing too much for an up-front specification, your project is already in trouble. But XPers claim that applications rarely look like their initial specifications, and those that do deny themselves the advantage of being flexible. If you're sailing to India, you may need to map out a general course, but you can't possibly anticipate all the changes in currents and winds along the way, so don't bother trying. In other words, don't commit until you absolutely have to.

Improving code, little by little

Even if XP goes the way of the pet rock, one idea that has already gained mainstream acceptance on its own is refactoring. Refactoring refers to a group of codified techniques for identifying and improving bad code, ruthlessly weeding out unnecessary code, and keeping the project as simple as possible.

Just how ruthless should you be? In his book, Refactoring: Improving the Design of Existing Code, Martin Fowler deconstructs one "smelly" method in one class into a total of 10 methods spread over seven classes, attempting to produce more rigorous, higher-quality, and easier-to-read code. Even writing comments in your code, one of the first rules of Programming 101, falls under Fowler's scrutiny: Code should be refactored to a state of such self-explanatory simplicity that comments are unnecessary. Although refactoring makes a lot of sense, so did comments, designing for reuse, and separate modular programming just a short time ago. It makes you wonder if we'll be reading about "defactoring" in a few years, with an example of how to combine those 10 methods back into one method.

Courage under fire

Sometimes XP takes the myopic view that everyone finds software as fascinating as developers. But many end-users don't want their applications to look and work differently each time they use them, and they'd prefer not to receive frequent, small releases.

In short, for project managers, deciding to use XP on your next project may in fact feel like bungee jumping off a bridge with a laptop. You must be confident enough to surrender a good deal of control, because you'll no longer have the authority to determine what you want and when you want it. Yet the methodology is also grounded in the hard realities and pitfalls of software development, and it offers many commonsense solutions. XP may not be the final word in the evolution of software development, but it certainly is a step in the right direction.





Bruce Conrad (baconrad@pacbell.net) is a freelance Java developer currently working on an eye-training application.



  BOTTOM LINE
Extreme programming
BUSINESS CASE
The XP approach recognizes that software development is difficult and different enough from other types of corporate projects to deserve its own methodology. XP promises to save time and money, while helping developers create better-quality applications.

TECHNOLOGY CASE
XP can be applied to any programming language, although it's best applied at the start of a development cycle, not partway through. Developers are encouraged to work toward fast release cycles and multiple iterations.

PROS

+ Improves communication

+ Introduces efficiencies in planning and testing


CONS

- May not always be easier than traditional development

- Users may not want frequent, small releases

- Requires rigid conformance to XP principles



RELATED SUBJECTS

Software Development
Enterprise Applications


SPONSORED WHITE PAPERS
EMC - Lower costs and improve reliability-Get the EMC CLARiiON white paper!
Ciphertrust - Are you ready for Sobig.G? Learn how to protect your email systems.
CDW - Personal attention. CDW. The Right Technology. Right Away.
EMC - Explore key performance features and capabilities of EMC ControlCenter 5.1.1.
Intel - Free Intel white paper shows you how to deploy a secure wireless LAN
Cisco - FREE WHITE PAPER: BLUEPRINT to design and implement secure VPNs
Verity, Inc. - "Mass Consolidation Hits the Web-Search Market"
McDATA - Download a FREE storage consolidation white paper from McDATA(R).
Lucent Technologies - Overcoming Common Firewall Limitations
Lucent Technologies - Leverage Your Mobile High Speed Data Access. Download Free White Paper!
Nokia - Get the scoop! Mobilizing business white papers & case studies.
BMC Software - Maximize the Potential of Enterprise Data: Free white paper!
Network Associates - Free white paper - Strategies for Optimizing Network Costs and Benefits
Entrust - Manage identities across applications. Improve productivity.
Stalker Software - CommuniGate Pro - Transform your Email and Calendaring
Remedy - A NEW Gartner Research Note:Producing Quality IT Services

Search the IDG White Paper Library:


SPONSORED LINKS

INFOWORLD MARKETPLACE


» Hot Stock Alert (TMDI)
Telemedicus - Medical Communication Top Telemedicine Technology
» Apply BPM and ITIL at your IT Help Desk
ServiceWise brings BPM to complete IT service while eliminating integration cost. Learn more here.
» EMC delivers high-speed image capture, storage
Learn how you can quickly capture, organize, and deliver information with EMC ApplicationXtender.
» Register for your free VMWare Virtualization kit!
VMware virtualization takes the cost and complexity out of IT  Download this free kit to learn how.
» FREE Sophos Threat Detection Test
Is your AV catching everything it should? Free virus, spyware and adware scan.




 HOME  NEWS  TEST CENTER  OPINIONS  PRODUCT GUIDE  TECHINDEX   About : Advertise : Subscribe : Contact Us : Awards : Events 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy

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.

Computerworld :: Network World :: CIO :: PC World :: Darwin :: CMO :: CSO
IT Careers :: JavaWorld :: Macworld :: Mac Central :: Playlist :: GamePro :: GameStar :: Gamerhelp
ITWorld Canada :: Computerwoche :: Techworld UK :: tecChannel :: IDG.se :: IDG.no