Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Semi-colons are mandatory in languages like C++ and Java, and optional in languages like LUA and SQL.
Most of my LUA code is very much littered with semi-colons not only out of force of habit but also because I consider them to be proper identifiers for separating logical statements similar to using punctuation in standard writing and if you were to consider how even a basic communication typed in English would look that did not use a comma or period or semi-colon to separate one complete thought from another or to connect relationships and logical conditions then you would end up dealing with quite the horrible run-on sentence much like the one you are reading right this very minute
Punctuation is your friend. Omitting semi-colons from Object Oriented code is acceptable "if" (and only "if") you have mature, compact code down to a science. I have seen the Nexus LUA code and yes, that is some very well written LUA. No semi-colons are needed there at all. However, most scripting/programming hobbyists can't achieve such elegance easily, so please, use your punctuation lol
Azel wrote:Semi-colons are mandatory in languages like C++ and Java, and optional in languages like LUA and SQL.
Most of my LUA code is very much littered with semi-colons not only out of force of habit but also because I consider them to be proper identifiers for separating logical statements similar to using punctuation in standard writing and if you were to consider how even a basic communication typed in English would look that did not use a comma or period or semi-colon to separate one complete thought from another or to connect relationships and logical conditions then you would end up dealing with quite the horrible run-on sentence much like the one you are reading right this very minute
Punctuation is your friend. Omitting semi-colons from Object Oriented code is acceptable "if" (and only "if") you have mature, compact code down to a science. I have seen the Nexus LUA code and yes, that is some very well written LUA. No semi-colons are needed there at all. However, most scripting/programming hobbyists can't achieve such elegance easily, so please, use your punctuation lol
proper punctuation means the difference between helping your uncle Jack, off a horse...and helping your uncle jack off a horse.
and I overuse ellipses as you have probably observed if you've been reading all the posts I make lately.
Azel wrote:Most of my LUA code is very much littered with semi-colons not only out of force of habit but also because I consider them to be proper identifiers for separating logical statements similar to using punctuation in standard writing and if you were to consider how even a basic communication typed in English would look that did not use a comma or period or semi-colon to separate one complete thought from another or to connect relationships and logical conditions then you would end up dealing with quite the horrible run-on sentence much like the one you are reading right this very minute
But Lua
like most other languages
already has a form of punctuation to separate statements:
line breaks
wow, I had no idea i would spark this discussion lol. I was merely confused about the semicolons. although now that I think about it, I may have had a similar discussion years ago in college while learning visual basic but I don't remember.
just on the subject, without offering my own opinion. I was under the impression that "redundant code is bad". meaning that anything you put in there that does not need to be there is just sloppy coding.
by that logic, semicolons are redundant in lua and it is sloppy to put them in. I'm merely saying this from an unbiased perspective.