clean-code-dotnet icon indicating copy to clipboard operation
clean-code-dotnet copied to clipboard

Use searchable names (part 2)

Open boop5 opened this issue 4 years ago • 2 comments

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
}

boop5 avatar Dec 02 '19 22:12 boop5

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.

dmitryvhf avatar Jan 05 '20 00:01 dmitryvhf

@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.

tiagossa1 avatar Apr 18 '20 16:04 tiagossa1