I was wondering, what is the preferred way to construct a new object in C#?
Take a Person class:
public class Person
{
private string name;
private int age;
//Omitted..
}
Should I create it to use:
New Person("name", 24);
or
New Person() { Name = "name", Age = 24 };
Is it just a matter of taste or is there a good reason to use one over the other?
I can imagine that one should only use the required fields in the constructor and optional fields not as constructor parameters but by using properties.
Am I right in that?