[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why is "then" required in the if statement?
- From: Fabien <fleutot+lua@...>
- Date: Sat, 1 Dec 2007 22:11:59 +0100
You can get rid of the "then" without adding ambiguity for the compiler. Ditto for the "do" in "while/do/end" and "for/do/end". There is a patch somewhere allowing this.
But if you want to save a couple of keystrokes, don't suppress keyword; pick a proper editor and customize its macros. The main interest of a well designed syntax is to improve code readability, and thus maintainability. It's always at least partially a matter of taste, but I'd guess most people would find "if foo then bar end" more readable than "if foo bar end". I definitely would, at least.