clean-code-dotnet
clean-code-dotnet copied to clipboard
Use searchable names (part 2)
I think you broke a rule within the example of another.
In Don't add unneeded context you say that this is bad
public class Car
{
public string CarMake { get; set; }
public string CarModel { get; set; }
public string CarColor { get; set; }
//...
}
But then you do it in Use searchable names (part 2)
public enum PersonAccess : int
{
ACCESS_READ = 1,
ACCESS_CREATE = 2,
ACCESS_UPDATE = 4,
ACCESS_DELETE = 8
}
So it actually should look like this IMO
public enum PersonAccess : int
{
Read = 1,
Create = 2,
Update = 4,
Delete = 8
}
But then you do it in Use searchable names (part 2)
This made only for fix PersonAccess = 4
to searchable names.
But you are right. Your example better.
@boop5 agreed. Your example looks better than the one provided on the repo, atlhough I prefer to write constants/enums/const names in Capslock. I find it easier to read.