3 ms·
Right. This is a typical language design mistake. It happens in phases: - "We're not going to have declarations in our language. First use defines a variable
by Animats 10y ago
Right. This is a typical language design mistake. It happens in phases:
- "We're not going to have declarations in our language. First use defines a variable".
- "We need some way to define local variables. But if we make that the default, existing code will break. So the default has to be global."
- Embrace the pain.
There are variants on this theme. Python is local by default. Go has variable creation by assignment with ":=", but with weird semantics for multiple assignment.
Other classic mistakes are "we don't need a Boolean type; 1 and 0 are enough", and "there's only one kind of integer". Fixing those later always sucks.