© 2007 The Smart Method Ltd
275
Appendix A: The Rules
The very best programmers are those that are fanatical about rules.
Some rules are so self-evidently good and great that it’s almost
impossible to find a programmer that could disagree with them. For
example The Cradle to the Grave naming convention is a very simple rule
that saves a massive amount of time and cost when programming any
project and makes information systems a delight to work with.
Proposing some rules can cause debate, and even sometimes anger,
amongst programmers who do not want to change the way they are used
to programming. For this reason, whenever a team project is undertaken
it is a good ideal to publish the rules and spend the first morning in a
meeting to ensure that all programmers agree and “buy into" them.
During this meeting it must be made clear that all rules are entirely
negotiable providing that a case for changes can be logically argued.
Some of our best rules have come from these brainstorming sessions.
The rules presented in this Appendix are a subset of The Smart Method’s
own rules that include generally accepted best-practice as well as some of
our own unique standards. Rules that apply to advanced concepts not
introduced in this book (such as user defined objects) are not included in
order to avoid confusion.
We use the “rule book" to QA all code prior to releasing the first version
of an application to a client. All code in this book should conform to the
rules (mistakes excepted).
You don’t need to adopt The Smart Method’s rules but they are a good
starting point to derive your own rules.
Never be afraid to break the rules when you have good reason to. As
Douglas Bader observed, they are only for guidance. When you do break
the rules, however, make sure you can justify (to yourself at least) why
you did it!
Never break the rules in a misguided attempt to save time by producing
“quick and dirty" code. You’ll waste far more time unravelling the mess
than you’ll ever save (but programmers still do this over and over again)!
Visual Basic is all-powerful and with power comes responsibility. Use
the power wisely, adhere to this programming standard (or your own
derivative of it) and write beautiful, robust code.
Rules are for the obedience of fools and the guidance of wise men.
Douglas Bader (British World War II fighter pilot) 1910-1982
A