I was making a modal operator and I needed some kind of global variable I could use as a "user preference" if you will. Whenever the operator is run, it checks if the value is True or False and runs the necessary code. If it doesn't exist then it creates it with a default value.
I managed by using something like this (an ID property?) which is great because I think it's saved with the scene and not per object:
context.scene["My Property"] = False
My code is already working just fine, no problems there. However, I discovered I can also do this (with optional extras I imagine are useful/necessary for UI Panels):
my_property : BoolProperty(default=False, name..., min... max...)
I just use this property to remember to turn on the wireframe for a selected object while the operator is running, that's it. I don't need to display it in any menu (at least not at the moment) and I don't need to save it in any file; it's just a temporary, non-persistant user preference.
Is there's any benefit of one method over the other if I just use it like a global variable?
I've read about Custom vs ID Properties but I'm too much of a layman to understand when to use different things.