Page 21 of 22

Re: Lua

Posted: Wed Nov 07, 2007 4:12 pm
by Gez
Graf Zahl wrote:Lua has a strong resemblance to Pascal. Which, by sheer coincidence also has a syntax I don't like. C's braces are really neat. They are just symbols. Structuring code with English language keywords just adds one more step the brain has to process before understanding the code.
Plus, it's easier for the parsers used by syntax highlighters to detect corresponding and/or mismatching parens (as a generic terms: (parentheses), [brackets], {braces}) than code words.

Some editors can also be configured to automatically insert the closing paren after the cursor when you type the opening one. I remember I got quickly used to this behavior when I used KWrite on Linux.

Re: Lua

Posted: Wed Nov 07, 2007 4:24 pm
by bagheadspidey
Graf Zahl wrote:Structuring code with English language keywords just adds one more step the brain has to process before understanding the code.
Hmm, we could always translate keywords into german ;)
Spoiler:

Re: Lua

Posted: Wed Nov 07, 2007 6:06 pm
by randi
I can't believe you guys are still discussing the Lua syntax. Since we're not using Lua ( :( ), it doesn't much matter, but: The structure isn't that much different from C except they opted to use English-like keywords instead of symbols. If you have no prior programming experience, which is going to be easier to learn: Symbols or words that probably already have some meaning to you?

Re: Lua

Posted: Wed Nov 07, 2007 6:14 pm
by bagheadspidey
randy wrote:If you have no prior programming experience, which is going to be easier to learn: Symbols or words that probably already have some meaning to you?
I thought the same thing that I assume you mean here (words having more meaning than symbols for less experienced users), but judging from the response to this thread this may not be the case. And with that, I'll resign myself from the syntax discussion ;)

Re: Lua

Posted: Thu Nov 08, 2007 2:40 am
by Graf Zahl
randy wrote:If you have no prior programming experience, which is going to be easier to learn: Symbols or words that probably already have some meaning to you?

Clearly symbols. The braces are universal and implicitly declare structure. This is something you can teach a child in 5 minutes and they will get it.

Words only declare something through their meaning. For non-English speakers this can be quite bothersome when learning to program. This can be particularly annoying with programming languages that have several different structuring elements which all use different keywords. But even if you understand the language the words are in well, you still have to process them, adding a completely unnecessary layer of comprehension to your programming work.

This ignores the uglier aspects of C-like syntax though which often negate this aspect of the language and lead to the conclusion that a language that is structured with keywords is easier to read.

Re: Lua

Posted: Thu Nov 08, 2007 4:11 am
by Gez
randy wrote:If you have no prior programming experience, which is going to be easier to learn: Symbols or words that probably already have some meaning to you?
You may think words, but symbols, actually. Ever wonder why we have all these icons on our applications? Ever wonder why signs similarly use icons much more often than words?

Also, the code itself is words and numbers. Having parens rather than more words to structure it make the structures easier to see at a glance. Compare:

Code: Select all

if (blah)
blablabla=getblah();
blahblah++;
endif
blableblibloblu(blahblah);
with

Code: Select all

if (blah)
{
blablabla=getblah();
blahblah++;
}
blableblibloblu(blahblah);
And I won't even speak of how words are less reliable than symbols. You don't have to know the language to guess that a { will be closed by a }. But an if may be closed by an endif or by a fi, depending on the language.

I've done a fair amount of Morrowind scripting, which uses keywords, and I would have gladly traded all these EndIfs for pairs of curly braces. Easier to see, faster to type, and friendlier to syntax checkers.

Re: Lua

Posted: Thu Nov 08, 2007 4:23 am
by Cutmanmike
Not quite sure what you're talking about here because I have almost nil pogramming experience, but I prefer the second option you posted there.

Re: Lua

Posted: Thu Nov 08, 2007 7:05 am
by TheDarkArchon
Symbols. Having worked with both BASIC and C(++), I can attest to the reading nightmare that is a BASIC program that even merely resembles complexity I.E the sort of thing I can do with my current level of C knowledge.

Re: Lua

Posted: Thu Nov 08, 2007 12:44 pm
by DoomRater
I dunno, I found the first example a bit easier to read. Had the symbols been used on the same line as the command (which, it seems, EVERYONE ELSE thinks is poor programming technique) I would have read it a bit more easily.

Re: Lua

Posted: Thu Nov 08, 2007 2:17 pm
by Graf Zahl
I think that was the point. The first example you have to consciously read each line to process its content. But in the second one the 2 braces immediately stand out, indentation or not.

Re: Lua

Posted: Thu Nov 08, 2007 4:46 pm
by DoomRater
No, I prefer grouping similar commands... these process much more easily for me. o_o

Re: Lua

Posted: Sat Nov 10, 2007 11:00 am
by Shadelight
I'm going to go with symbols.

Re: Lua

Posted: Sun Nov 11, 2007 8:29 am
by Kate
I'm used to indentation as a guide, so I can do either as long as it's done correctly. =P I read words more quickly though, the symbols I just wind up filtering out so I wind up having to re-read the same few lines to notice braces, most especially if they're not on their own line (which is very common, even in my own code). A combination of this can make it a nightmare to find a mismatched set of braces.

Re: Lua

Posted: Sun Nov 11, 2007 1:04 pm
by Necromage
I am in the middle with this one. Having spent my productive high school math classes doing nothing but messing around with the basic on the ti-83 I am pretty used to processing words. However, working with c/c++ I like using the braces. One thing I can't stand though, is the java indentation of:

Code: Select all

if(true) { //the open brace is here
    callsomefunction();
}//close brace
It just drives me insane.

The problem for with lua isn't the use of english words, its how the language is constructed all together. It just looks like a horrible mix of spaghetti code that I cannot follow.

Re: Lua

Posted: Sun Nov 11, 2007 2:04 pm
by Nash
Randy's already said that he's not going to implement Lua into the script (complete with a :( emoticon) so I think the discussion is pretty much over already...