Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
domrally
· 6y ago · 0 comments
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
Comments
[–]
0xcoffee
6y ago
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?
[–]
aliswe
6y ago
Default value, just like if you do { get; private set; } and never set it, or just { get; } and never do.