Closed pablomayobre closed 9 years ago
I must disagree with you here. Using underscores makes reading variable names much easier, at least to me.
PascalCaseCanBeHardToDistinguishClassesFromObjects
camelCaseIsJustAsHardToRead
under_scores_give_you_defined_spacing_without_ambiguity
letsallagreethatnospacessucks
While I prefer underscores, I'm open to community input.
Since you aren't integrating into an existing library or coding style (cough cough love3d) I imagine that it doesn't matter all that much.
The convention that fits best into Lua is probably under_scores
or nospaces
, but as previously mentioned, nospaces
really sucks.
GLOBAL_DONT_DO_THIS SomeClass variables_and_member_functions _things_nobody_should_touch_ever
and finally
loveFunctionNamesAndNothingElseEver
although, honestly, I use under_score in CPML and it's fine for class names. I don't feel strongly about that one.
I like what shakesoda said, though I use nospace for variables... and try to use singlewords for methods so I dont have to struggle at which naming method I should use...
Middle scores are nice too... I noticed after reading CSS, it is so readable, the same but with middle scores: on-mouse-pressed
well I still think it's too long but I like how it looks
Both middle and under scores are nice, they make things much easier to read IMO. I used to prefer camelCase but these days I write almost exclusively with under_scores.
I think I am going to go with underscores unless there is some serious community outcry. I prefer it and it fits well with Lua (though not necessarily with LOVE). I'll close this for now but if it becomes an issue later on, I will revisit it.
Just wanted to say it... I hate variables that look like
this_because_they_are_not_cool
hahaha. My point of view. I just hate writing things that dont add to the content or readability of the code