プログラミングで最も重要な技術の一つが、名前付けです。 且つ、センスが問われるものなので、上達は難しいものでもあります。 この記事では、様々な文献から抽出した名前付けに関する情報を雑多にまとめました。 -名前重要- ソフトウェアの設計のアプローチとして、『まず名前から入る』というのは、あまり語られていない秘訣としてもっと広く知られても良いように思います。 - まつもとゆきひろ 『プログラマが知るべき97のこと』 コミュニケーションの基礎 名前は、コミュニケーションの基礎となるものです。 私にもあなたにも名前が無ければ、疎通することは困難になります。 名前をコミュニケーションの基礎と見た場合に重要なルールは以下の通りです。 発音可能であること 検索可能であること ※現実世界のみであれば検索可能じゃなくても良いかも知れません。 プログラミングは、チームや複数人で行うことのほうが多いと思います。
よくプログラマー(エンジニア)は、 数学が得意な人じゃないと出来ないとか言われたりしますが、 個人的には数学というより、 英語が出来る(好きな)人の方が有利だと思っています。 だってプログラミングってコメント以外英語ですし。 「なでしこ」とかはありますけどw 僕は学生時代、どちらかと言うと数学が苦手なタイプでしたが、 英語はわりと出来る方でした(というか好きだった)。 もちろん、数学も出来た方が有利に決まっていますが、 普通にご飯を食べていく分にはそんなに必要無いと思います。 ということで、 英語の意味を理解すると、仕事が更に捗るんじゃないかと思いまして、 プログラミングとかウェブで出てくるけど、 ちょっと意味が分かりづらい英単語30個をまとめてみました! プログラミングで出てくる英単語30選 英単語読み方意味 allocate アロケート 割り当てる attr(attribute) アト
僕は、プログラムをする上で変数や関数に良い名前を付けるのはとても重要と考えています。 というのも、良い名前を付ければ、それだけでそのコードがしたいことの説明になり、コメントと同等の働きをすることもあるからです。 自分がちゃんとそれをできているのかはさておき、僕は普段から、できれば読みやすくて分かりやすい名前を付けたいと思っています。他の人も読むコードであれば、できればプログラムでよく使われるような単語を利用して書いた方がより分かりやすいです。 ただ、よい名前を考えるのって、ちょっと面倒くさいんですよね。僕はこれまで、英語の辞書を利用して、考えたりしていたのですが、「何か、プログラムでよく使われる単語をまとめたものはないか?」と探したら、ドンピシャのものがいくつかあったので、それらをまとめて以下で紹介します。 photo by Michael Coté codic codic – デベロッパ
メソッド名などをネーミングする際に、知っておくと便利な、接頭辞と接尾辞をリストアップしてみました。どのように元の単語の意味が変わるかのルールを知っておくと、よく使う単語をベースにボキャブラリーを増やすことができるので、覚えておいて損はないと思います。 使う場合は、当たりを付けて実際の使用がないか、Googleなどで調べてみてください。 1. pre-, post- / 事前〜、事後〜 per-は、元の意味に “事前に、前に”、post-は “事後に”という意味が付け加わえます。汎用性が高いのでとても便利です。afterやbeforeの代替になるかもしれません。 // 事前テストする function testBefore(); ↓ function pretest(); // 事後処理する function executeAfter(); ↓ function postexecute();
昔から「名は体を表す」と言ひます。クラスの名前がクラスの果たす役割と一致してゐるかどうか常に考へ続けませう。 ImageInfo, AccountData, etc. Info って何やねん? Data って何やねん? ImageInfo って Image とはどう違ふねん?? FooInfo や FooData よりも好ましいかもしれない名前の例: FooAttribute, FooProperty, FooMetadata, FooDescription FooConfiguration, FooSetting, FooParameter FooResult, FooStatistics, FooSummary FooBuffer, FooList, FooCollection, ... ProductListItem, TranslationTableEntry, etc. Prod
y***s: 英語にくわしいフバさんに質問なんですが y***s: 1300 みたいなのを 1.3 K bytes みたいなのに整形するメソッドってなんてメソッド名にすればいいんですか fuba: -h When used with the -l option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to three or less using base 2 for sizes. fuba: man ls にはこんなかんじでかいてる y***s: なるほど shunirr: human readable fuba: to_human_readable_string みたいなのだるそうではある sh
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く