3 ms·
The new array literals seem to supersede some previous syntaxes like new[] { 1, 2, 3 } goes to [1, 2, 3] in a lot of cases. But overall they are a _great_ addit
by terandle 3y ago
The new array literals seem to supersede some previous syntaxes like new[] { 1, 2, 3 } goes to [1, 2, 3] in a lot of cases. But overall they are a _great_ addition to the language playing around with them now so bravo.
Still not really sure how I feel about class primary constructors on the other hand, will give them some time to marinate.
- oaiey 3y agoShare the exactly same worries. Let us see.
- WorldMaker 3y agoHaving moved to writing records by default in many places such as models and "DTOs", primary constructors are a very useful "transition" tool in those cases of "this started as a record, but now needs to be a mutable class for X reasons" and means a little bit less code to entirely rewrite in the first pass. It's also useful for even just "I aesthetically like for my class 'View Models' to mirror their record 'Model' definitions a little closer".
- Smaug123 3y agoClass primary constructors have always been the default thing in F#, and I found it deeply annoying not to have them whenever I had to write C#, for what it's worth!