excessive / DOMy

A DOM-like GUI framework for the *awesome* LÖVE framework
Other
32 stars 2 forks source link

Naming Convention #2

Closed pablomayobre closed 9 years ago

pablomayobre commented 9 years ago

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

karai17 commented 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.

LPGhatguy commented 9 years ago

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.

shakesoda commented 9 years ago

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.

pablomayobre commented 9 years ago

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...

pablomayobre commented 9 years ago

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

karai17 commented 9 years ago

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.

karai17 commented 9 years ago

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.