Tuesday, August 29, 2006

A guide to good naming

A question that I often get is "what should I name it?"

The best advice I can give is to take off your 'developer' hat and put on your 'business' hat. The most meaningful names reflect the purpose of the artifact. I have found that most often the purpose is best defined in business terms.

For example, we have a component that notifies a user of a new task. We could call this componet "SendEmail" or "SMTPOut" but it is much more meaningful to call it something like "SendTaskNotification".

It's almost never appropriate to name things based on the technology used. My favourite example of this is to name your XmlDocument variable "xmldoc". Could this name be any less descriptive? Surely, if we are going through all the trouble to instantiate/use this variable it must have some purpose. When naming we need to highlight this purpose and ideally put it in terms of the task at hand without focusing on the technical. It would be much more descriptive to call this variable "PurchaseOrder" or something like that (if that it what it was being used for). It is obvious from the code that it's an XmlDocument so we don't need to name it that.

A big win for good naming is the massive reduction in the need to write comments to describe what the variable is for. Good name swill take you a long way to self-commenting code.

Tuesday, August 22, 2006

BizTalk 2006 Documenter has been released

Recently, the super handy UK SDC BizTalk 2006 Documenter utility (think NDoc for BTS) was released. I can tell you that after making the mistake (once) of retrofitting a 2006 project onto a 2004 machine so that I could run the documenter (the old version didn't support 2006) I'm really happy to see this update.

You can grab it here along with some other handy-looking BizTalk tools: BizTalk server 2006 Scripts: Home