-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
camelcase #216
Comments
I prefer using camelCase but this one is tricky, a lot of people prefer using other styles for naming variables and functions. I agree we need consistency but I'm not sure if camelcase is the right one to choose. |
@eliasCodes I agree that What I'm tempted to say is:
I think this would be reasonably beginner friendly ... thoughts? possibly related to: dwyl/abase#24 and dwyl/abase#26 |
Will you be mostly using hapi as the framework?
|
@nelsonic having a quick look at the rule specification, I can't see a way to implement that split between methods/functions and properties/variables. This would require us to write a new rule. I don't have a particularly strong opinion, and can see how your suggestion would make it clear what names hold values and which hold functions. @cristinecula We do use hapi, although I don't think we feel bound by their style-guide. For example, hapi's styleguide recommends using |
@cristinecula that's a really good question! (and something that requires clarification) However using for example: Variable Declarations http://hapijs.com/styleguide#variable-declarations Sure, we can use see:
|
@eliasCodes did you see http://eslint.org/docs/rules/camelcase#never ? For now I would suggest that we keep this rule set to:
To me this makes our code more beginner-friendly ... but as always I'm all ears for a different perspective. |
@nelsonic doesn't that still force you to write variables in camel case? i.e. it would make var myCamelCaseVar = 1; valid but var my_snake_case_var = 1; invalid. This is still one step closer to what you want, but not exactly it. But happy to change to your suggestion if you're happy with this. |
busy updating existing code to use |
@nelsonic with stylistic rules, I don't have particularly strong feelings. Happy to change to |
@eliasCodes if no-one else objects, I would be grateful if this was turned off ... not "urgent" tho. |
ok let's give a try to snake case, @nelsonic do you use snake case for everything (function name, variables, properties)? |
@SimonLab good question. I want to make the case |
A note on this here: https://github.com/dwyl/style-guide#variable-naming |
These guys did the Science: http://www.cs.kent.edu/~jmaletic/papers/ICPC2010-CamelCaseUnderScoreClouds.pdf or ICPC2010-camelCase-vs-underscore.pdf
|
http://eslint.org/docs/rules/camelcase
Prefer consistent naming convention, camel case is more idiomatic of javascript.
The text was updated successfully, but these errors were encountered: