Re:Shellcheck: a static analysis tool for shell scripts
by hyperpape on Thursday February 05, 2015 @07:26PM
(#9007096)
I don't think we know that. We know some notion of lexical scope is valuable, but function only vs block scope seems like an issue of familiarity/style.
Re:Shellcheck: a static analysis tool for shell scripts
by ScottBurson on Friday February 06, 2015 @12:43AM
(#9007854)
Okay, but that doesn't change my point that a single global scope is archaic, and for good reason.
Still, it's nice that 'var' exists in JS at all. The idea that variable declarations are unnecessary noise and should be elided -- an idea that dates back at least to BASIC -- is, in my opinion, one of the worst seductive ideas in programming language design. Unless your language has only a single global scope (like BASIC), it always causes problems -- and we know that block scope is important for nontrivial programs.
Elvish sounds interesting; I will have to check it out.