You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your variable names should be descriptive, and unique, such that it's easy to get a basic idea of the value of a variable before looking at it.
A variable called countr doesn't tell me anything about what the value of the variable is, and isn't great, especially when you have an argument to a function called country in the same file. It would be easy to confuse these two, and make mistakes.
When naming variables think:
What will the value of this variable be?
Is the name I'm thinking of either already used in my code, or, very similar to a variable already in my code?
The text was updated successfully, but these errors were encountered:
ZooeyMiller
changed the title
Confusingly name variables
Confusingly named variables
Aug 3, 2017
Your variable names should be descriptive, and unique, such that it's easy to get a basic idea of the value of a variable before looking at it.
A variable called
countr
doesn't tell me anything about what the value of the variable is, and isn't great, especially when you have an argument to a function calledcountry
in the same file. It would be easy to confuse these two, and make mistakes.When naming variables think:
The text was updated successfully, but these errors were encountered: