Let's look at it this way
Message message = new Message(
"[email protected]",
"[email protected]",
"I hope you like the second edition")
^^^ This part of the expression invokes the ctor of Message which takes 3 string parameters
{
Subject = "A quick message" // <= {Subject = "A quick message" }; what is it?
};
^^^ The next part then sets the Subject property on the new instance to the given value. This block is called the object initializer. You can set any property at most once in this block.
There are multiple way to initialize an object.. the following could all have the same effect. (Assumption: message class has public properties called From, To and Subject)
Message m = new Message() {From="F", To="T", Subject="Whatever"}; // default ctor followed by property setters
Message m = new Message {From="F", To="T", Subject="Whatever"}; // allowed to omit paranthesis for default ctor
Message m = new Message(sFrom, sTo) {Subject="Whatever"}; // parameterized ctor followed by property setter
Object initializers are essential when dealing with anonymous types / in LINQ. The following line creates a new instance of an anon type with From, To and Subject properties
var newMessage = new {From="F", To="T", Subject="Whatever"};
For more on this, refer to this MSDN page - Object and Collection Initializers
However object initializers require properties to be public and consequently the underlying types to be mutable. It is generally preferred to have "immutable" (once created, the value of the object doesn't change) data structures to prevent side-effects or accidental modification. Maybe that's the point Jon was trying to make... I dont have the 2nd ed.