A small program with global variables is equivalent to a single object with instance variables. Just less typing, plus some semantic differences that are imposed by the programming language.
It's probably better to encapsulate the variables somehow if the program gets to be more than one file or a hundred lines or so. Or if it's important enough to unit test or use in a multi-threaded way. This is just part of the process of cleaning it up for future use, along with adding comments.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A small program with global variables is equivalent to a single object with instance variables. Just less typing, plus some semantic differences that are imposed by the programming language.
It's probably better to encapsulate the variables somehow if the program gets to be more than one file or a hundred lines or so. Or if it's important enough to unit test or use in a multi-threaded way. This is just part of the process of cleaning it up for future use, along with adding comments.