Write Less Code: C# Properties
I inherited the responsibility of maintaining an internal development tool implemented in C#. I recently added new classes to extend the tool’s functionality. Several of the new classes uses several properties, and I found myself writing code similar to the following:
class Shape
{
    private int _width;
    private int _height;
    private bool _isVisible;
    public int Width {
        get {
            return _width;
        }
    }
    public int Height {
        get {
            return _height;
        }
    }
    public bool IsVisible {
        get {
            return _isVisible;
        }
        set {
            _isVisible = value;
        }
    }
    /* ... more code, including fields,
              properties, and functions ... */
}
Implementation of properties as is done in the above source code can fill whole screens. I found a concise way to write the above code while browsing references, and I present it here:
class Shape
{
    public int Width { get; }
    public int Height { get; }
    public bool IsVisible { get; set; }
    /* ... more code, including fields,
              properties, and functions ... */
}
According to Microsoft’s C# Programming Guide1, with auto-implemented properties, “the compiler creates a private, anonymous backing field that can only be accessed through the property’s get and set accessors.” Separate fields for auto-implemented properties are not used because of private, anonymous backing fields. Setting property values for auto-implemented properties without set accessors can be done by providing an initialization value when creating the auto-implemented property or by assigning a value to the auto-implemented property within the constructor. A reduction of lines is evident in the above source code.
This blog’s customized WordPress theme is finally updated with responsive web design elements. Reading a tutorial at w3schools.com, 
Benjamin Graham’s The Intelligent Investor motivated changes to my personal investment operation. My copy of the book was published around 2006 and contains Jason Zweig’s commentary relating Graham’s observations about the stock market to the then recent dot-com crash. Having had some exposure to the dot-com crash and being an active participant in securities markets through the Great Recession up until today, I see in current market conditions parallels with those Graham and Zweig observed. Seeing these parallels pushed me to adjust my portfolio.