I'm curious to see if people follow rules when coding in ROBLOX Lua. This can include things such as variable naming, code structure, etc.
This question can receive a large number of correct answers. Truthfully, if it works, then it works. The only issue is how fast your result is given.
In my opinion, the average person on Roblox will use tab when structuring code to show different scopes and press their enter key to give a blank area in their script to help their eyes see what is where. As players get more advanced, they may begin to realize how helpful peppering your code with comments is so in the future, you can quickly notice what you were doing when you made it.
Obviously, when naming a variable, you must do so in a way that gives a valid variable. Such as no numbers at the start. Also, the chances are that the variable in use has a name that shows what purpose the variable has, like Timer for a countdown.
However, you can normally tell if a player has a background in other programming languages if their variables start with a lowercase for the first word, that capitals for the rest, such as myVariableName
and variableName
. These people are most likely use to their variable starting lower case and the type of their variable being capitalized. Employee employee;
where the capital is the type Employee, the variable is employee.
To be honest, you should never obfuscate code so other people cannot read what you intend the code to do. We humans (I assume you are human) write with upper-level programming languages meaning the code we type tend to be closer to the language we speak than it is to the language a machine speaks because we need to read and understand it. The purpose is to be read by people, so I have learned. Otherwise, we'd be using binary, which is faster than transforming any language into binary.
This question is very opinion based and everything I have said may be disagreeable to another person who may have more knowledge than I do. Simply strive to have readable code that runs as fast as you can make it. Oh and if it's deprecated, do not use it. Stop