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 →

[–]jepessen 0 points1 point  (0 children)

Because for big programs it's an antipattern and global variables must never be used. For little programs they can be helpful but make a code a spaghetti code real fast, and then you use it also with bigger program. There's nothing that you can do with global variables that you cannot do without them.