News for hackers. Stuff that matters.
Re:.NET 6 Released by polskibus on Monday November 08, 2021 @01:56PM (#29152824)
I wish they put more effort into round 10 version of C# . Features presented will have minimal impact on productivity and maintainability.
Re:.NET 6 Released by sedatk on Monday November 08, 2021 @03:54PM (#29154127)
I've been a huge proponent of file-scoped namespaces and it's in C# 10. I think it'll improve code readability and maintainability significantly despite being a seemingly minor change. It's also in line with "minimal API" and "top-level code" changes. I wrote about it here: https://ssg.dev/a-pledge-for-namespace-directives-in-c-15a32...
Re:.NET 6 Released by tonicbbleking on Monday November 08, 2021 @02:02PM (#29152890)
Discriminated unions is one of those features that everyone talks about, but never gets championed. Wish C# 10 already had this feature. https://github.com/dotnet/csharplang/discussions/2962
Re:.NET 6 Released by keithnz on Monday November 08, 2021 @04:23PM (#29154464)
you can actually do them pretty easily in C# without language support anyways.

for instance, the F# example from https://fsharpforfunandprofit.com/posts/designing-for-correc...

can be done in C# like https://gist.github.com/keithn/ceeeed5f7eb567e1b2333747065d1...

almost similar amount of code, however, no exhaustive checking. Not that I find that to be much of a problem, but it would be nice

Re:.NET 6 Released by Smaug123 on Monday November 08, 2021 @06:40PM (#29155795)
But who needs sum types when you have the visitor pattern :troll_face:

https://blog.ploeh.dk/2018/06/25/visitor-as-a-sum-type/

Re:.NET 6 Released by keithnz on Monday November 08, 2021 @09:08PM (#29156870)
wow.....that is one way to do it.....yes. I would hate to think what a system would look like with many sum types in it
Re:.NET 6 Released by throw868788 on Monday November 08, 2021 @03:58PM (#29154180)
Maybe try F#? I know it isn't always an option but if you can, especially recently, its been quite productive to work in.
Re:.NET 6 Released by oaiey on Monday November 08, 2021 @04:02PM (#29154232)
Static interface members enabling generic math and other cool features slipped the C# 10 quality bar. That is why the release looks a bit thin.

But honestly, with file scoped namespaces and global usings ... there is enough to see.

Re:.NET 6 Released by int_19h on Monday November 08, 2021 @05:32PM (#29155149)
C# is already evolving fast enough that quite a few devs are uncomfortable with it. Speaking strictly for myself, I love getting new language features faster - but there's a balance to strike here for the overall good of the ecosystem. You don't want to drive out all the people who can't keep up.
Re:.NET 6 Released by ulugbek7 on Monday November 08, 2021 @03:57PM (#29154165)
I love C#10 for a few features. The language is developing rapidly. And C# is already productive. I would like to see fewer features in each release.