So this is the new lazy way to declare a class for storing data… well not yet maybe, but soon.

class Person(string Name, int age, int shoesize);

and to think of that it was not long ago this was considered bad and lazy coding

internal class Person
{
public string Name { get; set; }
public int Age { get; set; }
public int ShowSize { get; set; }
}

After all, this is the what happens when you use that code


internal class Person
{
private string _name="John Doe";
private int _age=55;
private int _shoeSize;

public string Name
{
get { return _name; }
set { _name = value; }
}
internal int Age
{
get { return _age; }
set { _age = value; }
}
public int ShoeSize
{
get { return _shoeSize; }
set { _shoeSize = value; }
}
}

But then… nowadays you can write it this way…

internal class Person
{
private string _name="John Doe";
private int _age;
private int _shoeSize;

public string Name { get => _name; set => _name = value; }
internal int Age { get => Age; set => _age = value; }
public int ShoeSize { get => _shoeSize; set => _shoeSize = value; }
}

or

internal class Person
{
public string Name { get; set; } = "John Doe";
internal int Age { get ; set ; }
public int ShoeSize { get ; set; }
}

Ok, so I wrote this mostly to remind myself in the future of different nice ways to write simple classes with only properties.