I'm trying to get a better understanding of general practice... specifically deriving this() in a constructor. I understand that its less code, but I consider it less readable. Is it common/good practice to do it this way? Or is it better to write a second constructor that handles it specifically?
public SomeOtherStuff(string rabble) : this(rabble, "bloop") { }
or
Public SomeOtherStuff(string rabble)
{
//set bloop
}
Any input would be greatly appreciated
this()
is a good way to have auto-properties on a struct type and still allow them to be set in a parametrized constructor. Without thethis()
, it requires you to use explicit backing fields. – Strepitousthis()
in structs that have auto-properties! Thanks! – Garibaldi