3 ms·
You don't need objects for that kind of encapsulation, just don't export your variables across module / unit boundaries.
by int_19h 2y ago
You don't need objects for that kind of encapsulation, just don't export your variables across module / unit boundaries.
- jwarden 2y agoYes good point. The module/unit acts as the singleton instance, in a sense, though that might be the incorrect way to put it. In any case, I think variables that are “global” but encapsulated in this way lose the potential for harm we associate with a global variable the whole program may be directly reading and writing.