Write code to be read.

Software code and tests are read much more than they are written.

Some people write code with the sole intent of making the program work. After all, that is the immediate goal, to deliver business value through working software. Most of the time, though, the creation of software is merely the beginning of a very long life. Good software will be used and expanded upon for decades.

Software is only written once. Over the next few decades, it will be read hundreds of times. If the software is written well and clearly communicates its intent to the reader, that software will be expanded and improved upon. If readers have trouble understanding the code, it will be more likely that the code will be replaced.

Take extra care to make what you write a lot easier to read. Both the main code and the tests. Well-written code should be a joy to work with and easy to expand upon.

This will make it easier to change later. There will always be a need to make changes later.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: