Skip to content

Instantly share code, notes, and snippets.

@BcRikko
Created November 22, 2016 04:48
Show Gist options
  • Save BcRikko/49ee3e00be49cc6a8328d43e2de4a9ac to your computer and use it in GitHub Desktop.
Save BcRikko/49ee3e00be49cc6a8328d43e2de4a9ac to your computer and use it in GitHub Desktop.
命名規約メモ

booleanを返すメソッド

  • is + 形容詞 (e.g.: isEnabled)
  • can + 動詞 (e.g.: canGet)
  • has + 過去分詞 (e.g.: hasChanged)
  • 三単現動詞 (e.g.: contains)
  • 三単現動詞 + 名詞 (e.g.: containsKey)

booleanを保持するフラグ

  • の意味にする
  • 肯定的な意味にする
  • ポジティブな意味にする

ex. isOpen, isVisible, isEnable

http://qiita.com/KeithYokoma/items/2193cf79ba76563e3db6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment