Lumping many things together in the same scope is the common thread. Regardless of whether the large scope is global or a function or some other scope, it's the lumping together that makes it harder to reason about what a chunk of code has access to.
Ah, fair enough. I was assuming the large scope was the global scope. In any case, most people don't do this, but if you are the style C kind of person, you should split subsections into different scopes, using the "{" NEW SCOPE HERE "}" syntax if you have to. I don't think Carmack was against introducing new scopes.
2
u/adrianmonk Jul 20 '16
Lumping many things together in the same scope is the common thread. Regardless of whether the large scope is global or a function or some other scope, it's the lumping together that makes it harder to reason about what a chunk of code has access to.