Agile development

Being agile

Agile development is probably the most popular and effective approach to software development

It consists of a collection of tools and techniques which work well in teamwork and in industry

These notes will pick out some of the ideas which work very well for small scale individual programming

They can increase your personal limit from a few hundred lines to a few thousand

The Step rule

Take small steps

A program should work almost all the time

Each small step should take you from a working program to a working program, with one more feature

The Function rule

Use small functions

Each function should be responsible for "one thing"

And it should be small enough to take it in at a glance

The DRY rule

Keep your programs DRY

DRY stands for "Don't Repeat Yourself"

If ever you see similar-looking code in two or more places, it is a symptom of potential problems - some people call these symptoms smells

The Magic rule

Make programs readable

Don't use statements that work as if by magic, e.g.

char c2 = c1 - 32;

Use easily readable names and formulas, e.g.

char c2 = c1 - 'a' + 'A';

Now the conversion to upper case is clear, and there is less knowledge of character codes built in

The Test rule

Automate testing

Without tests, there can be no confidence

Old tests need to be repeated in case programs break

Anything repetitive ought to be automated

Look up unit testing to find out more

The Refactor rule

Refactor programs

To keep programs in a working state all the time, you need to write simplified prototypes

As you progress, you need to change or even rewrite your functions

This is quite normal and is called refactoring, though you also need to avoid perfectionism

The KISS rule

Keep It Sweet and Simple

Don't over-engineer

Do the simplest thing that works properly