Gary Haran.com


Top 3 Agile Development Tips

Posted in Programming by gary.haran on the August 24th, 2007

Test Before You Write Code

Simple enough, writing a test allows you to officially describe what you you plan to write.

  1. write a test
  2. run it to see it fail - this means your test looks good
  3. write the code to make the test pass
  4. run the test to see it pass - this means your code works

Not only will you have better code because you put more thought into it but you will also have automated tests to prevent regression.

Code Atomically

A sailor must adjust the course whenever the wind changes. Sure if the changes are suddle he might be fine simply adjusting how tight the ropes are but if the changes are drastic he will have to do more than a slight adjustment.

Coding is the same except you are the sailor and all other programmers are the wind. Every time they make a change you potentially have to adjust course. How do you know? Well you have to checkin and update often to know.

  1. reduce the time between each checkins - this minimizes the chances of conflicts and if you need to revert you don’t have as much wasted time
  2. make each checkin fix a single problem - makes it easier to write commit message and track changes

Elegance Over Cleverness

Clever code is often too clever. It gives your colleagues a hard time when they need to read. Instead aim for elegance - less useless lines but more readable lines.

Leave a Reply