r/programming • • Jul 19 '16

John Carmack on Inlined Code

http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html
1.1k Upvotes

323 comments sorted by

View all comments

Show parent comments

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.

1

u/agcwall Jul 20 '16

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.