FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
TABLE OF CONTENTS
September 20, 2006
Coding Conventions: Make Them Agile

Simple rules let your team deliver high-quality code

(Page 1 of 5)
Jason Mawdsley
Documented coding conventions take the pain out of development
Jason Mawdsley is a project leader and Certified ScrumMaster at Macadamian Technologies. You can reach him at jason@macadamian.com.

Quick--where's your coding convention document? What do you mean you don't know?

If you're like most developers, the coding convention document you were given when you started your job is in the bottom of a drawer somewhere or gathering dust on that top shelf, out of reach. Coding conventions are supposed to be useful tools for creating high quality code, but because they are rarely written by the developers themselves, coding conventions are often viewed as handcuffs shackling developer style and creativity.

This doesn't even take into account developers who work on multiple projects. Or do consulting work. If you do, you can find yourself having to learn different coding conventions several times a year.

The Complex Adaptive System

In Managing Agile Projects, Sanjiv Augustine says:

Living systems such as projects are complex in that they consist of a great many autonomous agents interacting with each other in many ways. The interaction of individual agents is governed by simple, localized rules and characterized by constant feedback. Collective behavior is characterized by an overlaying order, self-organization, and a collective intelligence so unified that the group cannot be described as merely the sum of its parts. Complex order, known as emergent order arises from the system itself, rather than an external dominating force. These self organizing Complex Adaptive Systems (CAS) are adaptive in that they react differently under different circumstances and co-evolve with their environment.

Development teams are a perfect example of a Complex Adaptive System. They're made up of technical, creative, highly intelligent, and autonomous developers interacting with each other in many ways.

Coding Conventions In the Complex Adaptive System

No wonder developers react badly to coding conventions, especially when they are imposed from higher up the food chain or are leftovers from a previous project. This kind of coding convention:

  • Doesn't arise from the system itself.
  • Is an external dominating force.
  • Doesn't react differently in different circumstances.
  • Doesn't evolve with the environment.

For it to be useful to a development team that matches the Complex Adaptive System criteria, a coding convention will have to consist of rules that are:

  • Simple.
  • Localized.
  • Reactive to feedback.

With these rules, emergent order comes from the team itself, rather then an external dominating force like a coding convention. These CASs are adaptive in that they react differently to different situations and environments, and evolve over the life of the project.

The Agile Coding Convention

Simple rules let your team deliver high-quality code as efficiently as possible. With this in mind, my agile coding convention consists of these simple rules:

  1. Make your code look like other people's code.
  2. Use the simplest design possible.
  3. Don't re-invent the wheel.
  4. Document your code.
  5. Keep security in mind.
  6. Work in increments.
  7. Work in iterations.
  8. Have your code reviewed.
  9. Don't stay blocked.
  10. Do unto others as you would have them do unto you.

1 Introduction | 2 Rules 1-3 | 3 Rules 4-6 | 4 Rules 7-10 | 5 Conclusion Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK