logoalt Hacker News

shevy-javatoday at 3:32 AM4 repliesview on HN

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.


Replies

xonretoday at 6:09 AM

For 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`.
show 2 replies
Dylan16807today at 5:06 AM

Python spells "then" as ":"

In Ruby you can choose between "then" and a newline.

This is very pot calling the kettle black.

mjmastoday at 6:10 AM

English too

modularedtoday at 4:11 AM

[dead]