Created
July 18, 2013 01:14
-
-
Save yoshio-kinoshita/6025964 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.NET フレームワークの識別子のネーミングルール | |
.NETの世界に触れて間もないので、ネーミングルールが分からんので標準ルールを調べ | |
てみました。 | |
参考:http://msdn.microsoft.com/ja-jp/library/ms229043.aspx | |
識別子 記法 例 | |
クラス Pascal AppDomain | |
列挙型 Pascal ErrorLevel | |
列挙値 Pascal FatalError | |
イベント Pascal ValueChanged | |
例外クラス Pascal WebException | |
読み取り専用の静的フィールド(read-onlyなstaticフィールド) Pascal RedValue | |
インターフェース Pascal IDisposable | |
メソッド Pascal ToString | |
パラメタ camel amount | |
プロパティ Pascal BackColor | |
ネームスペース Pascal System.Drawing | |
インスタンスフィールドやローカル変数に対するルールがないので、なんでもいいってことですかね? | |
ただ、ハンガリアン記法は使わないほうがいいようですね。 | |
Microsoft内でもハンガリアン記法は非推奨とのことです。 | |
ハンガリアン記法というのは変数名にそのデータ型を示すいくつかの小文字を使用した | |
プレフィックスをつけることです。例えば、 | |
Dim sName as String = "Yoshio Kinoshita" | |
とか。です。 | |
しかし、ハンガリアン記法によってインスタンスフィールドや静的フィールドとローカ | |
ル変数の混同によって引き起こされるバグを防ぐことができます。 | |
また、スレッドセーフに関するエラーを見つけやすくすることができます。 | |
そんなコード書くエンジニアにソース書かせるなよ・・・ | |
って意見は置いときます。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment