LoginSignup
3
1

More than 3 years have passed since last update.

変数命名でよく迷うやつ

Posted at

個人的変数命名

今後、どんどん追加していきたい。
コメントも反映します⭐︎

複数形

変数 解説
index インデックス (i, idx)
indexes indexの配列 (ids)
articles 記事の配列
article_id 記事のID
article_ids 記事IDの配列, article_id + s
articles_id いくつかの記事をまとめたID
関数 動詞
get_article 一つの記事を取得する
get_articles 複数の記事を取得する

よく使う単語

関数 解説
get_〇〇 〜を取得する
calculate_〇〇 〜を計算する
generate_〇〇 〜を生成する
display_〇〇 〜を表示する
format_〇〇 〜を整形する
fetch_〇〇 〜を取得する
import_〇〇 〜をインポートする
convert_〇〇 〜を変換する
complement_〇〇 〜を補完する
save_〇〇 〜を保存する
show_〇〇 〜を表示する

Boolean

Boolean
created_article 記事が作成されたか or not
is_method〇〇_enabled 手法が有効か or not
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1