When naming variables, functions, classes, etc, what naming conventions do you use? PascalCase, camelCase, Snake_Case, or other? Do you keep it consistent across all value types or do you mix it up for different types?
I prefer to use the alllowercasenounderscores case for all of my variable and function names (does anyone know what this case is actually called?) When I am naming objects I usually use PascalCase but I’m sometimes inconsistent.
edit: also I think you should move this to the discussion category.
I’d recommend some kind of spacing or differential characterizing to improve code readability, because if I were trying to read code with names like alllowercasenounderscores i’d opt out
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.
Personally, I use camelCase for most non-instance variables and all instances’ variables (often they’re named in Pascal, but the variable names will be camel). I use SCREAMING_SNAKE_CASE for stuff that’s going to be configured by non-programmers or just generally configurable “constant” values. However, if you’re new enough that you’re not really “set in your ways,” so to speak, I recommend following the style guide that colbert posted.
Although that’s what I do, it doesn’t really matter much, as long as you’re consistent throughout your script and it’s readable. Just please don’t use nocaps* or sPOngEbObCasE.
* I’m not entirely sure on any “official”/popular name for no capitalization or separation.
Also, this is really nitpick-y, but this isn’t technically snake_case. A “true” snake_case would be all lowercase. The case you used is called Darwin_Case.
For specifically Luau, I use PascalCase. Sometimes I randomly user camelCase or alllowercase though. PascalCase fits with Roblox best as it’s what they use (mostly).