games
pages
posts

iconSyntax

2000-01-01

I prefer a syntax with no redundant punctuation. That is, no semicolon after each line. There's hardly much need to argue for it, as most of the new script languages who don't retain C syntax for historic reasons do this already (e.g. Python, Ruby, Lua). Arguments like ''We also put a fullstop after each sentence."' make no sense, as program text is not to be read sequentially by the programmer like normal text, but should be structured so you quickly find something in it.
I also prefer not having things like braces around code blocks, or a colon after each definition or block statement. Again, it can be argued that it serves for quick visual identification. But really, I doubt that - if not even an indented line is an indication of a new block starting to someone, then adding a { or : hardly helps.
There's no doubt that whatever one is used to is the easiest to use. But when looking at syntax, to a degree, we must look what is most natural. Everyone immediately will know what "1 + 1" should do, or what "x = 5" should do. Python, Lua and Ruby all do a good job here initially. Ruby soon adds lots of perl-like syntactic "sugar".. which in my opinion just makes most examples of Ruby code lose its beauty and readability. Lua stays true to utmost simplicity, so there's a rather fixed syntax, with keywords like "then" or "end" all over the place. Python improves that that by making proper indentation mandatory and therefore not needing redundant keywords. They still have mandatory : for starting a block, and () for function calls - which in many cases could un-ambiguously be left out. So there's no winner around currently.