0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

リーダブルコードを読んでの個人メモ(1)

0
Posted at

メモ

1.明確な単語を選ぶ
2.凡用的な名前を避ける(使う状況を選ぶ)
3.具体的な名前を使う
4.接尾辞や接頭辞を使って情報を追加する
5.名前の長さを決める
6.名前のフォーマットで情報を伝える

sendの代替案

単語 単語の意味
delivery 配送
dispatch 急送、発送
announce 発表する、知らせる
distribute 分配する、配る
route 決まったルートを経て送る[届ける]

findの代替案

単語 単語の意味
search 探す、捜索
extract 取り除く
locate (場所を)探し当てる
recover 回復する、取り戻す

startの代替案

単語 単語の意味
launch 開始する
create 作成
begin 始める
open 開ける

makeの代替案

単語 単語の意味
create 作成
set up 設定、並べる
generate 生成する
compose 構成する
add 加える
new 新しい、新品

filter()
例)DBに問い合わせる場合を想定するとfilterは曖昧
・select (選択)
・exclude (除外)

限界値を決めるときはmaxとminを使用する
・max_ (最大)
・min_ (最小)

範囲を指定するときはfirstとlastを使用する
・first(始まり)
・last (終わり)

包含/排他的範囲にはbeginとendを使用する
・begin(始める)
・end (終わる)

ブルー値(true,false)に名前をつけるとき
・is + 形容詞
 ex) isEnabled = 現在有効

・has + 過去分詞
 ex) hasSent = 送信済み

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?