upvote
> This feels like adding braces to Python because you don't like indenting your code.

Now this I can get behind...

reply
Ruby has both kinds of operators as well, and it's fine. The thing in Ruby, though, is that the English logical operators have lower precedence than the symbolic logical operators, so you can use them in place of parentheses. Sometimes that's confusing, other times it can be used to make code very readable.

In general, I would expect symbolic operators to be desirable in complex boolean expressions, because "loud punctuation" stands out among English words when reading the code.

reply
Same in Perl, hence the good old pattern:

    open my $fh, '<', 'input.txt' or die;
reply
yes, ruby inherited this from perl, though 'or' has lower precedence than 'and' in perl, and they're equal in ruby. Which sounds like something going to cause mistakes, but I yet to see 'and' and 'or' together in the same expression in ruby.
reply
I've always found it odd that and/or in Ruby isn't just considered equal to &&/||, and I have never really used the english operators except for the usual modifiers like if and unless.

What is a practical use case where the lower precedence makes sense?

reply
Those two behave in the same way if you drop the parentheses:

1. statement if (condition || something)

2. (statement if condition) or something

reply
> Why though? What does changing `and` to `&&` actually achieve? Were people confused?

Also consider AI, that has a greater training base of JavaScript than Lua. So making Lua look more like JS, should improve output and reduce mistakes.

reply
No, don't consider AI.
reply
I can't imagine that making the differences between the languages more subtle would improve the performance of chatbots. Subtleties aren't their strong suit.
reply
AI has greater training on Python, which uses `and` and `or`, and it has absolutely no issue keeping that straight.
reply
deleted
reply