[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Say No to global-by-default
- From: Sean Conner <sean@...>
- Date: Wed, 4 Jul 2018 16:06:25 -0400
It was thus said that the Great Egor Skriptunoff once stated:
> On Wed, Jul 4, 2018 at 10:39 AM, Petri Häkkinen wrote:
>
> > you probably understand why having to prefix every global with $ would
> > make our eyes hurt...
> >
> >
> Actually I didn't understand why.
I can't give an objective reason, but for me, using sigils for scope
(which is what Ruby does if I recall correctly) triggers my aesthetic
sensibilities.
Anyone can get used to anything [1], thus the subjectivity.
> > I also think typos in variable names are pretty easy to find and fix.
>
> I don't think so.
> Typo in local variable name may result in hard-to-find bug.
I've used luacheck to find typos and inadvertant globals. It's easy to
use, and if you use some form of source control, most give you a way to run
scripts prior to code checkin, so you could have the checkin fail if
luacheck finds an issue.
Does it suck to have to use another tool? I don't know. For me, it's
worth it.
-spc
[1] http://boston.conman.org/2008/01/04.1
Yes, I was used to seeing BASIC presented that way. Doesn't mean I
would accept that now. I got better.