[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thoughts on optional commas
- From: Tomas Lundell <tomas.lundell@...>
- Date: Sun, 4 Mar 2012 12:30:54 +1100
> Occasionally I forget commas when I create large nested tables in Lua. It
> reminds me of when I was learning c and always forgetting to place semicolons at
> the end of a line. I'm so happy that semicolons are optional in Lua. I wish
> commas were too.
In my opinion syntactical sugar is best used to enhance readability rather than aid beginners. I promise that you'll learn to remember the commas.
> I agree that it is unfortunate. It seems sad to miss an opportunity to simplify a language to accommodate an obscure part of the syntax.
Perhaps it is obscure to you, but a lot of people use and like that syntactical sugar. It makes certain things cleaner, especially emulating named parameter calls:
create_box { width = 2, height = 3 }
as opposed to
create_box({width = 2 height = 3})