OpenArgs (my) class way (4 Viewers)

JFTR: VBA does not have garbage collection. Memory for object variables is released based on COM reference counting.
 
I thought so. But I usually iterate and destroy all the items before destroying the container object. After all, if we really trusted the garbage collector, we wouldn't even consider destroying the container object...
No you do not. You do not destroy anything. All you are doing is releasing a pointer. But if this makes you feel better continuing doing it.

If you believe that VBA does not have a trusted clean up, I say prove it.
All this discussion about setting objects to Nothing is usually a complete waste of time. What you think you are doing is not really doing anything. You are simply releasing a pointer. You are not triggering "garbage collection" or memory clean up. VBA takes care of that.

There are times to close open connections and there are a few times to set objects to nothing. But you are really better off understanding the exceptions instead of thinking you are doing something by setting everything to nothing. At the most I set objects to nothing 1% of the time, but it is for a specific reason. Some of this is described here.



People find it easier to just set all objects to nothing based on an urban myth, than trying to understand when and why.

You can disagree with this, and again I say prove it. Show some cases where the code fails when not setting something to nothing. I can demonstrate some of those cases.

I the last twenty years of actively posting stuff on forums, I am sure I have posted 100 of thousands of lines of vba code, 1000s of example dbs, 100s of class modules and rarely if ever set an object to nothing. Only once did someone come back and say the code failed. And this case falls into one of those exact cases explained in the article that I should have taken care of. So I guess I should have set about 100 thousand other variables to nothing just to catch this one case.
 
Last edited:
@jwcolby54 I guess your openargs class only replicates the built in functionality since you haven't been able to provide any reason I might want to invest the time to use it.
 
@jwcolby54 I guess your openargs class only replicates the built in functionality since you haven't been able to provide any reason I might want to invest the time to use it.
LOL, it is not my job to provide any reason for you to invest the time to use it. We all tread the path we tread on this earth. I have explained in some detail what a framework is, what mine does, and how this specific tiny little part of my framework contributes to the whole. You apparently have no interest in such things. You are intentionally baiting it seems. You are you and I am, thankfully, not. A little baiting of my own! :ROFLMAO:

In any event I will place you on my ignore list.

If I can figure out how to do that.
 
In any event I will place you on my ignore list.
Good move since you are no teacher. Teachers always answer honest questions respectfully. Just FYI. No novice is following this conversation and the experts all know what a framework is and all of them practice strong design principles but thanks for the lesson anyway.

My takeaway is - your openargs class adds nothing to Access that doesn't already exist.
 
No you do not. You do not destroy anything. All you are doing is releasing a pointer. But if this makes you feel better continuing doing it.

If you believe that VBA does not have a trusted clean up, I say prove it.
All this discussion about setting objects to Nothing is usually a complete waste of time. What you think you are doing is not really doing anything. You are simply releasing a pointer. You are not triggering "garbage collection" or memory clean up. VBA takes care of that.

There are times to close open connections and there are a few times to set objects to nothing. But you are really better off understanding the exceptions instead of thinking you are doing something by setting everything to nothing. At the most I set objects to nothing 1% of the time, but it is for a specific reason. Some of this is described here.



People find it easier to just set all objects to nothing based on an urban myth, than trying to understand when and why.

You can disagree with this, and again I say prove it. Show some cases where the code fails when not setting something to nothing. I can demonstrate some of those cases.

I the last twenty years of actively posting stuff on forums, I am sure I have posted 100 of thousands of lines of vba code, 1000s of example dbs, 100s of class modules and rarely if ever set an object to nothing. Only once did someone come back and say the code failed. And this case falls into one of those exact cases explained in the article that I should have taken care of. So I guess I should have set about 100 thousand other variables to nothing just to catch this one case.
Funny you should mention that. I understand "last pointer" thing but IMO the vast majority of devs do not. The man asked a simple question, I gave a simple answer. I am (or more correctly was) deep into classes and frameworks, where objects loaded other objects, kept pointers to forms, passed those pointers (and others) into the classes they were opening. I absolutely did have issues when I didn't intentionally clean things up. I had forms not closing. I had Access not closing because something was hanging out that the Access couldn't shut down. Not setting that "last pointer" to nothing can and does cause issues. And so I do, intentionally, with malice and forethought, religiously clean up behind myself.

And if you don't, or think I am silly... <shrug> It's sad there is no shrug emoji. I thought I had seen one.

In any event I was just in the process of starting a thread about the so called garbage collector in VBA. It is not easy to get it all pasted in, and keep the
Code:
thing around everything. But I am trying!

I expect a lively discussion. I probably will not participate since this is just an academic interest to me, and at the moment I am doing other things.
 
Good move since you are no teacher. Teachers always answer honest questions respectfully. Just FYI. No novice is following this conversation and the experts all know what a framework is and all of them practice strong design principles but thanks for the lesson anyway.

My takeaway is - your openargs class adds nothing to Access that doesn't already exist.
Now do me a favor and (since you are such a great instructor) tell me how to ignore your posts?
 
Good move since you are no teacher. Teachers always answer honest questions respectfully. Just FYI. No novice is following this conversation and the experts all know what a framework is and all of them practice strong design principles but thanks for the lesson anyway.

My takeaway is - your openargs class adds nothing to Access that doesn't already exist.
533 views as of this instant. But hey. I have no metrics to tell me how many of those views are novices etc, or who follows things.

And you are right I am no teacher. I have answered you same "issue" over and over and you either don't understand or choose not to understand.

In the end I am just a guy who was unfortunate enough to run into and annoy you in my threads:sick:. It has been mildly amusing if nothing else. And it has been, mostly, nothing else.

You are an "acknowledged expert" (and yes @NauticalGent I am using the quotes intentionally) here but TBH you haven't contributed anything useful to my threads. EVER that I can remember.

Are we having fun yet?
 
Well, isn't it a form of garbage collection?
I am setting up a discussion on how VBA's garbage collection works. Is it a "garbage collector"? Who really cares. What does that really mean? Such an existential discussion we launch into. In the end it takes care of releasing the memory used for our objects when we release them. The generic term for that is garbage collection.
 
I am setting up a discussion on how VBA's garbage collection works. Is it a "garbage collector"? Who really cares. What does that really mean? Such an existential discussion we launch into. In the end it takes care of releasing the memory used for our objects when we release them. The generic term for that is garbage collection.
The thread on "garbage collection on VBA" is up there now.
 
You are an "acknowledged expert" (and yes @NauticalGent I am using the quotes intentionally) here but TBH you haven't contributed anything useful to my threads. EVER that I can remember.
Except I gave you that cool code that fixes a broken seed.
 

Users who are viewing this thread

Back
Top Bottom