Wednesday, January 13, 2010

Are my old coding habits still valid?

"I document my Code
I've done it all my life
It makes the job take longer
But it keeps me out of strife"
I forget where I first heard that rhyme but I believe there is merit in its suggestion. A customer recently questioned my desire to document even my smallest code modules and when I stood my ground on the matter he started picking apart my Lotusscript (beware the semi-literate customer). He was quite firm in denying the need for the 'PHASE z - Housekeeping' section that I habitually add to the end of my code eg.


' PHASE z - Housekeeping
Set db = Nothing
Set OrgView = Nothing
Set NewOrgParentDoc = Nothing
Set ContactDoc = Nothing


I must admit that disposing of objects in this manner is a habit that I developed many moons ago and I'm not sure if its still needed in today's Lotusscript. Am I being too careful here and wasting my customers coding dollars or is this kind of object recycling still Best Practice for Lotusscript?
.

2 comments:

Brownie said...

I would guess that it would take you all of 30 seconds to write that code regardless of it being needed or not!

I find it strange when someone believes that getting the code done quicker saves money! The value of most applications is not in the code at all but in how well designed it is and the usability. Simply trying to ruduce the code and hence save a few minutes or even a few hours isn't going to make an app any better and in the long run I would suggest that the design work provided by an experienced consultant such as yourself is going to save far more time in reducing poor productivity or usability in the future.

They can get some code monkey to punch out the code in half the time maybe (maybe not:) and the $ might be cheaper but the outcome more expensive!

Spanky said...

For Instantiation or Disposal;
automation is fine.
There is a slight pitfall;
you don't know the time.

'Tis better to own it;
keep your obj vars terse.
Though you're laughed at as old school;
You know your shit works!