开发者

Why Hashtable is not PascalCase?

开发者 https://www.devze.com 2023-01-10 04:37 出处:网络
I strongly try to follow general rules in coding styles. But when i look at .NET, i see that some of classes doesn\'t match PascalCasing rules. One of them is Hashtable and the other one which i remem

I strongly try to follow general rules in coding styles. But when i look at .NET, i see that some of classes doesn't match PascalCasing rules. One of them is Hashtable and the other one which i remember is Stopwatch. I think there are more which i don't remember them.

Is there a reason to leave PascalCasing rules for those classe开发者_如何学JAVAs ?


Because they are both dictionary words.

You probably need a technical dictionary for hashtable, but stopwatch is a legitimate word.
PascalCasing is for cases where you combine different words to the name of your class (* and such), it isn't concerned with the linguistic origin of the word.


Thats mostly old code and not by purpose. Some would call it a mistake. Imo Stopwatch is correctly cased (stopwatch vs hash table, notice the blank).

Funny note: javas Hashtable is not PascalCase either while the new HashMap is (here im sure it was a mistake as josh bloch says so in effective java afaik)


It is not a "hash table" but a "hashtable" (as far as I know), so the PascalCasing of that word would then be accurate. Same for "stopwatch". Could be wrong about hashtable though..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号