Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
@jezeke

Description

@jezeke

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, orCREATE TABLE itemTable instead of justitems). This goes hand-in-hand with the "avoid context-duplication" rule too.

One edge-case to consider is date type variables- whereby you may haveitem.dateAdded, and simply removing the type from the name leaves you withitem.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 beaddedAt. This defies the A/HC/LC pattern somewhat however, so take it as you will.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp