Skip to content
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

Add example for variable names with multiple words #17

Closed
r-mueller opened this issue Nov 11, 2016 · 4 comments
Closed

Add example for variable names with multiple words #17

r-mueller opened this issue Nov 11, 2016 · 4 comments

Comments

@r-mueller
Copy link

Regarding https://www.pythonsheets.com/notes/python-basic.html#python-naming-styles.

An example for variable names with compound words would be nice.
For example. Should a method local variable be called userName or user_name?

@crazyguitar
Copy link
Owner

crazyguitar commented Nov 11, 2016

Based on PEP8 - Method Names and Instance Variables

Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability.

It imply that using user_name not userName.

I think python like under_scope style rather than CamelCase.

CamelCase seems only used by ClassName and TypeVariable and no mixedCase.

@crazyguitar
Copy link
Owner

Oh!! Do you mean add some examples like below?

# good

user_name = 'Guido'

# bad
userName = 'Guido'

@r-mueller
Copy link
Author

Yes this was the idea. I did not know PEP8. And from https://www.pythonsheets.com/notes/python-basic.html#python-naming-styles. it was not clear on how to seperate names in variables. But now i know it is user_name 😃

@crazyguitar
Copy link
Owner

OK! I will add it later! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants