Professional Documents
Culture Documents
Items
Items
Придобивки:
-Конзистентност на тимот
-Конзистентност со .NET framework
-Полесно се чита и разбира кодот
-Code review се фокусира само на функционалноста, не на синтаксата
Типови
-PascalCase
Секој збор започнува со голема буква
-camelCase
Првиот збор со мала буква, останатите со голема
// Avoid
int iCounter;
string StrName;
}
}
//Correct
var seattleCustomers = from customer in customers
where customer.City == "Seattle"
select customer.Name;
//Avoid
var c = from customer in customers
where customer.City == "Seattle"
select customer.Name;
//avoid
a = b * c;
//correct
_weeklyPay = hoursWorked * hourlyPayRate;
// Correct
public TimeSpan timeLeft;
private DateTime _registrationDate;
try
{
//
}
catch (Exception ex)
{
//GENERIC
Logger.WriteErrorToLog(ex.ToString());
//"log";
Logger.LogIntoBetO2File(ex.ToString());
//text file
Logger.LogIntoBetO2File(ex.ToString(), "InsertOddsForEvent");
}
namespace Management
{
public class Person
{
private static decimal _weeklyPay;
Ref:
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions
https://github.com/ktaranov/naming-
convention/blob/master/C%23%20Coding%20Standards%20and%20Naming%20Conventions.md