2 ms·
My theory is that most of the offending language designers looked at variable declaration in languages with static typing and thought "Wait, we don't have stati
by chromatic 15y ago
My theory is that most of the offending language designers looked at variable declaration in languages with static typing and thought "Wait, we don't have static types, so there's no reason to declare variables!"
- JoshTriplett 15y agoPersonally, I like the opposite solution, used in functional languages: "Wait, we don't allow changing variables once created, so we only need to support variable initialization with a value, not reassignment of a variable or declaration without initialization!"
- masklinn 15y ago> used in functional languages Used in some. Haskell and OCaml mandate scope binding (unless you're at the top level of a module). Erlang does single-assignment (really pattern matches aliasing, an extremely limited version of Prolog's unification) without scope declaration, but what other FP languages do that?