Best name for property?

Which of the following three options would you choose for a property name in C # and why?

  • YearToDateWages
  • YTDWages
  • Ytdwages
+3
source share
10 answers

I would go with 1. I prefer not to shorten anything unless it is a too common acronym that would be ridiculous to say. Something like "HyperTextTransferProtocolRequest" would be ridiculous to describe, so it's safe to shorten it like "HttpRequest". This is a bit subjective, but when in doubt, I tend not to cut back.

2 3, , , 3, " ". , , 3 , . ... "ID", "Id". , , 3 + , .

+14

YearToDateWages, , .

. MSDN:

, . . , , .

. .

.

, OnButtonClick, OnBtnClick.

, , .

.

+5
bool ShouldIUseAbbreviate(string abbreviate_)
{
  foreach (var peer in myPeers)
  {
    if (!peer.CanGetTheMeaningWithinOneSecond(abbreviate_))
    {
      return false;
    }
  }

  return true;
}
+4

, , .

+2

# 2

, > 2 , Xxx XXX

2 XX

, YtdWages

+2

.

, , . NET Framework , # 1 .

/, , .

+1

, . , "YTD" , . YearToDate , .

0

, ?

; - 2 , .

0

.Net, , # 1. . , , . , () , , , .

- XML ​​ HTTP.

string x=myobject.HyperTextMarkupLanguageOutput;
0

1.

, . Visual Studio .

Note: If you cannot find a suitable name ... perhaps the planned use is not so clear;)

0
source

Source: https://habr.com/ru/post/1746486/


All Articles