Re: Revisiting an old friend: Set oRS = Nothing

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Michael D. Kersey (mdkersey_at_hal-pc.org)
Date: 05/08/04


Date: Sat, 08 May 2004 11:07:05 -0500

Bob Barrows [MVP] wrote:
> I still can't get past this:
>
> The VB/VBA documentation has always stated that COM objects are dereferenced
> when they go out of scope. When Eric says: "The script engine will
> automatically clear those variables when they go out of scope", he isn't
> saying anything that the docs haven't said for the last umpteen years.
>
> Yet bugs have been documented that have been corrected by explicitly
> destroying them. A couple people on that blog page talked about the old DAO
> Database object bug. Another referred to the intemittent IIS failures that
> were corrected by explicit cleanup of ADO connection objects. This tells me
> that COM _never behaved the way it was supposed to_. Why am I supposed to
> all of a sudden start trusting it to behave correctly just because we have
> another OS or another version of IIS? To me the burden of proof is rather
> high, and would have to involve explaining how the previous failures
> occurred and what's been done to prevent them. Instead we get people like
> Eric treating us as if we are idiots who don't understand scope and "how COM
> works".
>
> Bob Barrows

An excellent summarization. Such bugs as described in
http://www.4guysfromrolla.com/webtech/060999-2.shtml will keep me
performing such practices as setting objects to Nothing until I write
my last line of code. This I consider a good example of another
metaphor: "defensive programming".

Microsoft has had it's share of so-called "regression bugs"
http://www.sciencedaily.com/encyclopedia/regression_testing
wherein a bug in an older version of software is re-introduced in later
versions (often skipping versions). Such occurrences reinforce the
utility of defensive programming.

IMO the OP (and Eric Lippert) are merely fascinated with their
(apparently) recent discovery of the cargo cult metaphor. But the
metaphor has been in common use on the Internet for years prior to
_their_ discovery of the term, e.g.:
http://groups.google.com/groups?q=cargo+cult+programming&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=r&as_drrb=b&as_mind=12&as_minm=5&as_miny=1981&as_maxd=8&as_maxm=5&as_maxy=1988&selm=326%40decvax.UUCP&rnum=1

Nonetheless, to use yet another metaphor, just as
"To a child with a hammer, all the world looks like a nail.",
so those children among us who have only recently discovered the term
"cargo cult programming" are wildly eager to share with everyone their
newly-discovered "hammer" and possibly to use it to hammer other
programmers. Lippert and Microsoft in general are newbies to the
Internet however, so we can surely forgive their enthusiasm.

 From another perspective, I would maintain that _all_ users of
Microsoft products are _necessarily_ "cargo cult" users because
Microsoft doesn't reveal their source code and we necessarily _cannot_
understand how their systems work. As a result, superstitious practices
abound in the Windows world ("Heck, I dunno; why don't you reboot the
system?").

Indeed, to be intellectually honest, _everyone_ is a "cargo cult"
person, because _everyone_ uses words and tools which they do not
understand (at some level), yet which they trust to work (e.g., I would
be hard-pressed to build an automatic transmission for my car, even
given the scrap steel necessary to make the parts). So we're merely
talking about the _degree_ to which we are "cargo cult" programmers. But
to the best of my knowledge there is no consistent "cargo cult scale"
that we can neasure differences with, and so, at that point the metaphor
ceases to be useful.

Good Luck,
Michael D. Kersey



Relevant Pages

  • Re: Ancient history [was Re: Public disclosure ...]
    ... >who were programming in C didn't seem to fully understand the range of ... by security concerns instead of merely avoiding crashes. ... No one can "fully understand the range of possible effects of bugs." ... presumably a feel for the numuber of computable functions. ...
    (sci.crypt)
  • Re: Static vs Dynamic
    ... (Java has too much noise in its source code, ... lot to ask and is typical in a typed language supporting polymorphism. ... > developers can easily learn the Java programming language; ... > obivous bugs slip through and b) in many cases, ...
    (comp.lang.lisp)
  • Re: Priority Queue confusion
    ... Using Macros ... 90% probability of 90% bugs being generated at run time. ... Programming is programming, there's no reason ... Using anything can definitely cause problems in debugging. ...
    (comp.programming)
  • Re: Revisiting an old friend: Set oRS = Nothing
    ... > their recent discovery of the cargo cult metaphor. ... I think this stretches the analogy too far. ... I disagree with the assertion that we are all cargo cult programmers. ... question is worth asking, it's worth posting. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Is this a good idea?
    ... you risk introducting bugs into ... in memory - induces lazyness in the programmers. ... >> few MB per script, ... Sometimes it does not - sometimes, due to lazy programming or bad DB design, ...
    (comp.lang.php)