1)
What's the policy for declaring a variable? Should you always use the keyword private
, or is it OK to skip it?
string MyVar1;
vs.
private string MyVar1;
The only reason I see is that Microsoft one day can change the default access modifiers to public
instead of private
.
Where does it say that private is optional? Any references to MSDN?
2) Naming policy for constants?
I have always used caps when writing a constant, but a friend told me that it's against the Microsoft naming policy, is it?
const string MYVAR1;
vs
const string myVar1;
3) Pascal or Camel?
Personally I think that Camel just looks ugly.
“A few” digunakan dengan countable nouns (kata benda yang bisa dihitung), contohnya book (buku), house (rumah), person (orang), dan lain-lain.
A Few Vs Few “A few” menunjukkan jumlah yang sedikit, namun konotasinya positif. Sedangkan determiner “few” menunjukkan konotasi negatif alias “kurang”. Penggunaan “a few” mengimplikasikan makna “some” (beberapa), sedangkan penggunaan “few” merujuk pada makna “not a lot” (tidak banyak) atau kurang dari yang diharapkan.
Jika few digunakan dalam kata benda yang bisa dihitung atau countable noun. Namun little digunakan untuk kata benda yang tidak bisa dihitung atau uncountable noun.
1) The private
keyword is optional. I highly doubt that Microsoft will ever change the default visibility of fields as this would be a massive, breaking change (not to mention a stupid one). Omitting the private
keyword is merely a matter of personal taste.
2) Don't use "shouty" constants - follow the convention of the framework and use pascal casing (e.g. ThisIsAConstant
is preferable over THIS_IS_A_CONSTANT).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With