News for hackers. Stuff that matters.
Re:What's New in C# 9.0 by domrally on Thursday September 10, 2020 @01:39PM (#24434665)
Init only setters are a dream come true. Property initializer syntax to me is very readable and lack of read-only support after initialization was the main reason i avoided using it
Re:What's New in C# 9.0 by 0xcoffee on Thursday September 10, 2020 @02:19PM (#24435059)
It was unclear to me from the article, if you don't set an init property during construction, does it get default value or compiler error?
Re:What's New in C# 9.0 by aliswe on Thursday September 10, 2020 @05:14PM (#24436633)
Default value, just like if you do { get; private set; } and never set it, or just { get; } and never do.