3 ms·
Lua has a lot of useless syntax. For instance, the "then". I have been using ruby and python for many years. Lua is living in the old age here. That's just one
by shevy-java 3mo ago
Lua has a lot of useless syntax. For instance, the "then". I have been using ruby and python for many years. Lua is living in the old age here.
That's just one example of so many more. I get that lua occupies a useful niche with its focus on embedded systems, but lua is not really a well-designed language in general. JavaScript has a similar problem.
- modulared 3mo ago[dead]
- Dylan16807 3mo agoPython spells "then" as ":" In Ruby you can choose between "then" and a newline. This is very pot calling the kettle black.
- mjmas 3mo agoEnglish too
- xonre 3mo agoFor readability, `then` allows splitting with newlines very long conditional expressions, without having to wrap the condition in parentheses: if x + y + z > a or verylongconditionalhere () or anotherverylongconditionalhere () then ... after `if` and `elseif` the parser simply goes on until it finds `then`.
- drunken_thor 3mo agoAgreed, it keeps the parser fast as well because it is a lot more clear when the boolean statement ends and the code block begins. You either need parentheses, `then` or brackets around the block to make parsing clearly defined.
- nmz 3mo agoThis is something I don't see a lot of people do. I've tended to do for long,list,of,variables,here in ageneratorhere(bigparameterhere) do end and local x do -- everything after is just here to define x end I'm still a little irked it works so well, the only alternative would be for the language to have labeled blocks. but that might be too terse