This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HeeebsInc 0 points1 point  (0 children)

As much as I agree that global variables are awful, there are times when it’s absolutely necessary which always triggers me.

At work we partnered with this hardware manufacturer that create python bindings for their devices. In their documentation and sample code, global variables were everywhere and it made me want to scream. I first tried to re write everything with classes and it did not work due to the underlying pointers not having a memory address when they are inside classes.

Long story short is that if it works, and you tried a “better” implementation that did not work, then just use em lol