3 ms·
The reason is legacy. I personally lint all my code to prohibit global writes, and I wish I wouldn't have to. Hopefully by now language designers realise that
by tomlu 14y ago
The reason is legacy. I personally lint all my code to prohibit global writes, and I wish I wouldn't have to.
Hopefully by now language designers realise that anything-by-default is wrong. (That's right, I'm looking at you, Python.)
- anonymoushn 14y agoWhat linter do you use, and does it have vim integration?
- tomlu 14y agoI wrote my own. It basically imposes some restrictions on the way you are allowed to use Lua with respect to globals (with escape hatches). It also hooked into our Python-like import system. It checked illegal global writes and reads, illegal imports, unused imports and unused locals.