lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Feb 12, 2013, at 8:37 AM, Michael Richter <ttmrichter@gmail.com> wrote:

On 12 February 2013 00:57, William Sumner <prestonsumner@me.com> wrote:
I think it's a little inaccurate to portray it as a "bikeshedding" debate, as if syntax is a solved problem and any discussion of it is off-limits.

I don't think it's very much, if any at all, beyond a bike shed debate.  Syntax is, for all practical purposes a solved problem.  Syntax is largely, past a certain point of expressiveness, utterly unimportant.  Semantics rules the day.

People saying it's too hard to remember ~= over != are arguing the colour of the bike shed and nothing beyond that, IMO.  I "speak" a dozen or so programming languages semi- to fully-fluently (most of these having far more alien constructs than ~ vs. ! in inequality statements) and have no problem at all remembering things.  Perhaps this is because I spend my time learning the language and its idioms instead of wishing it was Yet Another Curly Brace Language.

Unlike you, I'm not perfect, and neither are my users!

Lua's utility as a configuration language makes syntax an end-user feature. I have to consider the demographics of who will be scripting my application: hobbyists who will at most have experience with C-like syntax and behavior. This doesn't necessarily mean "Yet Another Curly Brace Language" (doesn't Lua count?). Python and Ruby use C's inequality operator. Some syntax has become a convention across a spectrum of programming languages that otherwise aren't C-like.

Another example of syntax affecting users would be the comma used to separate elements in table declaration syntax. Tables are used for data description in my application. If the comma separator between elements was optional, it would make for a simpler data description language. See this contrived example:

    local thing = {
        name = "Thing"
        description = "This sure is a thing"
        height = 7
        attributes = {
            hitPoints = 200
            magicPoints = 50
            armor = 15
        }
    }

The point of all this is that if users are annoyed with a particular aspect of the language, they're annoyed with my application, so I have an incentive to address it, perhaps by editing Lua's source or considering alternative languages. In other words, because the language is exposed to users, its syntax is a part of my application's user interface.

This isn't to say that the inequality operator is a high priority issue. I just wanted to respond to the general idea that Lua's syntax is a solved problem and that it's not important. I think it's even more important because the language is exposed to users. There is always a degree to which such discussion can be taken too far, but I don't think it's a convincing argument to dismiss all discussion because Lua has always done things a certain way. As a matter of fact, Lua's syntax is one of the most common complaints about it.

Preston