Google Testing Blog: Code Health: IdentifierNamingPostForWorldWideWebBlog
This is another post in our Code Health series. A version of this post originally appeared in Google bathrooms worldwide as a Google Testing on the Toilet episode. You can download a printer-friendly version to display in your office.
By Chris Lewis and Bob Nystrom
It's easy to get carried away creating long identifiers. Longer names often make things more readable. But names that are too long can decrease readability. There are many examples of variable names longer than 60 characters on GitHub and elsewhere. In 58 characters, we managed this haiku for you to consider:
Name variables
Using these simple guidelines
Beautiful source code
Names should be two things: clear (know what it refers to) and precise (know what it does not refer to). Here are some guidelines to help:
Read full article from Google Testing Blog: Code Health: IdentifierNamingPostForWorldWideWebBlog
No comments:
Post a Comment