2 ms·
Not only that, it's a relatively gentle introduction into object oriented concepts, where an instance is just like independent copies of modules, as they're usi
by nomel 2y ago
Not only that, it's a relatively gentle introduction into object oriented concepts, where an instance is just like independent copies of modules, as they're using them: module.function(), with function accessing some global conceptually turns into instance.function() where function accesses some instance "global".
I was always a bit surprised that python didn't allow "module instances" that automatically did that.
- bongodongobob 2y agoHonestly the way I learned not to use a ton of global variables was because I used so many and would forget what they'd do. But that was back in the days of Apple // BASIC so when I was introduced to C I rejoiced. People need to learn from mistakes.
- nomel 2y agoFor me, I learned when I wanted all my function calls to do the same thing no matter how many times, or order, I called them. I often wonder how much "pain" is required to really learn something. I would claim that 90% of how I write code is the result of pain, not patterns, even though they often end up being similar.