Open utterances-bot opened 5 years ago
I don't understand, what would a statement saying "-1" ever mean?
@wolfboyft It wouldn't mean anything useful, but it's still perfectly valid code in most langauges, because they allow you to use an expression anywhere where a statement would be valid.
@17cupsofcoffee If expression-statements don't do anything but, as Lua has proven, there's no reason to have semicolons without them... are they not just pointlessly forcing you to use semicolons?
@wolfboyft It's not entirely pointless - the main arguments I can think of in favor of allowing expression statements are:
Whether you think those arguments outweigh the benefits is up to you :) I've since switched my language back to using semicolons, but that's more because I personally find they make the code more readable - I'm still not totally convinced that expression statements are entirely necessary.
This was super useful, thank you!
@pes18fan No problem, I'm glad people are still finding it useful 5 years (?!) later 😄
How Lua Banished the Semicolons - Joe Clay
My current pet project outside of work is developing a little programming language called Ein. I decided fairly early on in development that I didn't want Ein to have semicolons, so I've spent a fair chunk of the past week investigating how other language…
https://www.seventeencups.net/posts/how-lua-banished-the-semicolons/