30 ms·
> Variables have to go somewhere. Good luck finding them amidst all the confusing rolling, picking, duping, etc. Of course you don't want to use roll or pick.
by astrobe_ 10y ago
> Variables have to go somewhere. Good luck finding them amidst all the confusing rolling, picking, duping, etc.
Of course you don't want to use roll or pick. That's tutorial-level knowledge that you shouldn't use them.
What you do when you see that coming is that you offload something to a global variable. The "something" is often the central topic of some part of the program, like a file handle for instance. So it makes sense to put it in a variable because it's needed in many places.
- progman 10y ago> Of course you don't want to use roll or pick. That's tutorial-level knowledge that you shouldn't use them. I think the opposite is true. Basic, Assembler and Forth were my first languages. Forth was the one that was the most powerful, and it showed me best on bare metal how a computer works.