Change The Default Value of Boolean

C Sharp 6.0 has introduced a nice new way to do this:

 public bool YourBool { get; set; } = true;

This is equivalent to the old way of:

    private bool _yourBool = true;

    public bool YourBool 
    {
        get { return _yourBool; }
        set { _yourBool = value; }
    }

see this article http://blogs.msdn.com/b/csharpfaq/archive/2014/11/20/new-features-in-c-6.aspx


Because booleans are false by default, I use positive forms in my names, like IsInitialized, HasSomething etc. which I want to be false by default until I explicitly set them.

If you find you need something to be true by default, maybe you need to rename your variable so it makes more sense when the default is false.