Every time I read code on the Developer forum, I see people misusing local and placing them inside functions. Is this a terrible idea, or are there any benefits to doing so? I nearly always utilize globals inside functions that are specified in parameters.
i personally believe this is a bad idea but i want to hear what other have to say
here is some examples
No, using local is proper. You should always use it. The only case where you wouldn’t use local is if you wanted to use getfenv or if you had more than 200 local variables in a scope. Neither of those should ever happen if you’re programming right. Feel free to ask me to elaborate on anything if you want, I’m on mobile right now so I’m a little slow to type.