Draft for list of good practices

jonasbn on 2008-01-31T22:34:51

As I wrote in my previous journal entry, I am working on a list of good/best practices.

This is what I have so far, I have plenty of other things, but these might be too Perl specific, so I will save these for later.

So here is my current draft for a list of good practices.

  • Keep your subroutines small, for easier test and readability

  • Encapsulate complexity for faster understanding and readability. Blackboxes can be skipped at first glance to be revisited later.

  • Make your components distributable so they can easily be deployed else and everywhere

  • Keep your distributions as small as possible, so you only distribute logically related functionality and not unrelated components, resulting in unwanted side-effects upon deployment and avoid installing unnecessary stuff since later examination of installations can be misleading

  • Version everything, distributions, components, documentation etc.

  • Make your components environment agnostic, so they can move from development/test/staging/product/whereever without code changes

  • Make your components configurable so configuration changes can be made without code changes

  • Make your applications environment agnostic so they can be executed everywhere and not necessarily only on designated environments, if not possible make at least sure that the are testable

  • Test everything that could possibly break. Do not make assumptions about environment, encoding or execution.


I know you have something to add or at least a comment, so please let me know.


Corrolary

petdance on 2008-02-01T00:14:50

Test everything that ever has broken. If it breaks, write a test for it before fixing it.

Re:Corrolary

jonasbn on 2008-02-01T08:00:37

Doh! how could I forget that, it is one of my favorite practices as you might can read I even forget to use this strategy.

But when I have used it has proven magnificent.