News for hackers. Stuff that matters.
Re:.NET 8 by terandle on Tuesday November 14, 2023 @02:50PM (#38268633)
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.

Re:.NET 8 by oaiey on Tuesday November 14, 2023 @03:19PM (#38269099)
Share the exactly same worries. Let us see.
Re:.NET 8 by WorldMaker on Tuesday November 14, 2023 @04:54PM (#38270374)
Having 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".
Re:.NET 8 by Smaug123 on Tuesday November 14, 2023 @05:45PM (#38270900)
Class 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!