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

Suggestion: Add section or clarification about datatypes in variable names #37

Open
jezeke opened this issue Jan 25, 2021 · 0 comments
Open

Comments

@jezeke
Copy link

jezeke commented Jan 25, 2021

One major contributor of code smell (in my opinion) is code that superfluously includes the type of the thing in its name. (e.g. List itemList, or CREATE TABLE itemTable instead of just items). This goes hand-in-hand with the "avoid context-duplication" rule too.

One edge-case to consider is date type variables- whereby you may have item.dateAdded, and simply removing the type from the name leaves you with item.added, which is very unclear (sounds more like a boolean flag set if the item has been added). My personal preference is to follow the form of At. So, dateAdded would be addedAt. This defies the A/HC/LC pattern somewhat however, so take it as you will.

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

1 participant