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

Naming #113

Open
TaylorSmith28 opened this issue Mar 1, 2023 · 3 comments
Open

Naming #113

TaylorSmith28 opened this issue Mar 1, 2023 · 3 comments
Labels
good first issue Good for newcomers

Comments

@TaylorSmith28
Copy link
Collaborator

While the variables, functions, classes, and files conform to pep8 naming conventions (snake_case, PascalCase, etc.), the naming of many variables, classes, functions, file are poorly named. All names should be review and proper names given.

@TaylorSmith28 TaylorSmith28 added the good first issue Good for newcomers label Mar 1, 2023
@scorcism
Copy link

scorcism commented Mar 2, 2023

Hey, can i work on this?
can could you elobrate more on the task ?

@TaylorSmith28
Copy link
Collaborator Author

Of course! We appreciate all the help we can get!

Some good function naming standards would include:

  • function names should be verbs if changes program state
  • function names should be nouns if returns a certain value
  • get (if the function returns something) i.e. getTemperature()
  • set (if the function set a mode or updates a variable) i.e. setTemperature()
  • is or has (if the function returns a bool) i.e. isAtTemperature()
  • a function should not have its class as part of its name i.e. get_pump_volume() should just be get_volume()

Some good variable naming standards would include:

  • if a name can be shortened without losing meaning it should be
  • variables should be nouns
  • fully uppercase if the variable is a constant

It would be nice if class names and file names are unique from all other classes and files in order to avoid confusion.

Scope naming could also be considered:

  • if a variable is in a class but used outside of the class it should be a member variable i.e. self.variable
  • all member variables should be declared in the class init function
  • if a variable is only used in a class but across multiple functions, in the class, it should be a private member variable i.e. self._varaible
  • if a variable is only used in a function it should not be a member variable i.e. variable
  • if a function is only used by other functions in the class it should be a private function

These would be some good things to look out for and ensure consistency across the files. We would greatly appreciate your help to clean up this code, if you have any more questions feel free to ask.

@scorcism
Copy link

scorcism commented Mar 4, 2023

Thank you for the guidance.
But, coz of my my Exam in this month i wont able to work on this.
Can i Work after that or you can assign this to some other mates?

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

No branches or pull requests

2 participants