Dave
Thu May 06 14:22:42 CDT 2004
Aaron Bertrand - MVP wrote:
>> As our intranet is built on ASP/JScript code that DOES NOT
>> "dereference" objects, I would think we would have noticed
>> a memory leak by now.
>
> That's one environment. So I may agree that, since you have avoided
> the "worthless" advice and it has not turned out to have adverse
> effects, then it is certainly fine for you to continue doing so.
I know this thread is meandering a bit, but Chris was referring (or should I
spell it refering in here?) specifically to JScript. With VBScript,
virtually every resource instructs the use of Nothing assignment. There is
simply no consensus for dealing with GC in JScript. And I contend there is
no parallel.
> However, in general recommendations for the majority of the
> newsgroups, e.g. people who have myriad environments and possibly few
> resources to test potential memory leak problems, I still don't feel
> that the advice is worthless. If it saves one person from having a
> memory leak issue that they can't track down (and it has happened to
> many people, just search Google), then to me that is not worthless.
Again, I don't deny that it has been useful. I'm asking whether it still is.
After reading Eric Lippert's article, I got the nagging feeling that the
advice is being perpetrated thoughtlessly. I know guys who still code buffer
restrictions into their JCL because it USED TO BE NECESSARY, and despite the
fact that our JCL parser overrides those limits with larger values. At what
point to we insist that they stop using deprecated features? When do we stop
advocating "cargo cult programming"?
http://en.wikipedia.org/wiki/Cargo_cult_programming
> If 14 characters really makes or breaks your "code size limitation"
> problem, I'd say you are developing code which is too close to the
> edge already, and that it is merely convenient that you find this
> statement unnecessary.
I never said I find it unnecessary. I expressed an interest in knowing if it
still IS NECESSARY. I started this discussion because of Lippert's article,
not because we were pushing those limits.
> I think you are considering this issue from a much more selfish
> perspective than the rest of us. Which isn't a bad thing,
> necessarily, but you're planning to generalize, and deem "worthless,"
> advice -- based solely on your environment and observations. I don't
> think it would be fair for the rest of us to start telling people
> "don't bother setting objects to nothing."
Give me a break Aaron. I'm not deeming anything worthless, I'm asking if we
should, as a group, revisit our assumptions. I'm asking if it still has
relevance. Lippert suggests this is a reasonable question to ask.
Like you, I don't think it would be fair to start telling people such a
thing. But I am willing to ask if we need to continue advising them the
opposite. I would be thrilled if someone could demonstrate that it continues
to be a solution to a real, ongoing problem in version x+1. At least that
way, I could confidently give advice I "deem worthwhile".
> I still think it's a good practice because there are still 3rd party
> COM objects out there, being written by who knows who... better safe
> than sorry, and all that.
I'm going to bite my toungue on this one.
> And while you're there, might as well code consistently, even for those
> statements that you allegedly "know" are "worthless."
You know that's an unfair distortion of my argument.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.