O'Reilly logo

Extreme Programming Pocket Guide by Chromatic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Coding Practices

Writing code is the most important practice in software development—very few projects can succeed without writing code.[3] Most of the time and energy devoted to a project are concentrated on producing code. Consequently, XP is very much concerned with code.

The code is the most important artifact of the project—without it, the project does nothing. It is the final authority on how the system actually behaves. As a developer, code is your business. This focus worries many people, who fear that XP is the domain of cowboy coders who jump headfirst into hacking without planning. This is not the case. XP uses working code to validate and to evaluate its plans. The four coding practices work together to produce code that is easy to maintain and extend and is always ready to be delivered to the customer.

Coding Practice 1: Code and Design Simply

Goal: to produce software that’s easy to change.

Code and design simply. Solve the customer’s current need. Resist the urge to guess at future needs, whether you’re designing the next feature or coding it. XP has three rules that govern simplicity: Do the Simplest Thing That Could Possibly Work, You Aren’t Gonna Need It, and Once and Only Once (these are explained in Part VI).

Flexibility is the goal. Simplicity is the means to that end. Simple designs are easier to understand and to explain. Simple code is easier to test, maintain, and change.

XP spends comparatively little time creating designs before writing code, preferring ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required