colbert2677
(ImagineerColbert)
January 2, 2020, 2:31am
7
https://roblox.github.io/lua-style-guide/
I loosely follow this as best as I can nowadays.
That aside: this kind of thread has been posted before, so you probably shouldn’t have posted it since it’s in essence a duplicate.
Here are some threads I was able to dig up by searching lua-style-guide, since there's usually someone who posts it on any thread about naming conventions.
(Lounge topic - accessible to members only)
should I name by table like
local TBL = {}
or
local tbl= {}
And are these considered variables or references to objects…?
Hi guys!
I’ve been creating a roleplay-oriented game that I often write code for but eventually end up disliking. I’ve been writing a lot of frameworks recently independently to see what conventions I do and don’t like and incorporate the good parts into my roleplay game’s framework; however, I still am never content with specifically the organization of my code.
Therefore, I’m curious about what your guys’ scripting preferences/idiosyncrasies are.
What casing convention do you use? camelCas…
As of 2019-06-15T04:00:00Z (UTC), I am a total newcomer to Lua. For this question, I will be demonstrating with general, simple, code from Python.
I usually organize code like this:
# Variables
number=1
# All variables (strings, numbers) go here and are mentioned in functions.
# Functions
def hi():
print(number)
# Code
hi()
# To keep as short and neat as possible, this is meant to call functions and variables.
Is this way of organizing good for Lua too?
I was recently introduced to a tool called “code style” in my java class that analyzes the style of your code based on a standard and tells you how to fix any inconsistencies. For example, if you don’t put spaces before and after an operator, it will tell you to add spaces.
My question is whether there exists a check style tool for Lua? I can’t find one with a quick search.
local money = 5
local jumpBoost = 2.5
local aRandomVariable = 5
local UserInputService = game:GetService("UserInputService")
-- service name is UserInputService is it appropriate to use userInputService or UserInputService
I’m not sure if I should use camelCase for all variables to keep everything consistent or to use the actual service name become it’s referencing the service which already has a name
also is it better to use camelCase for functions too or is it neater if it’s only variables
…
There is no doubt that Scripting is one of the most valuable aspect in Successful Games and arguably one of the most important skill to learn in Game Development.
In this Thread I would like to share my experience, guides, tips & tricks from my years of Scripting; I have freelance, collaborate with Developers, teach new scriptures and currently teaming up with a Family.
Naming Variables
I've seen a lot of bad code with terrible Variable Names Here are a few Examples;
local myCharacter
l…
Hey there! I’m MrAsync. I’ve been programming with Lua for almost 4 years. I’ve been improving constantly and have learned a lot. However, I’m at a point where I would like to improve my code organization, efficiency and readability.
What am I looking for?
To put it simply, I would like some tips for the following from experienced programmers
Commenting styles
Efficiency
Code organization
General tips
Here’s some examples of my current code as a reference. Am I commenting too much? Are …
9 Likes