Live data from Hacker News

New in C# 10: Easier Lambda Expressions

dontcodetired.com

71–80 of 111 posts

Re: New in C# 10: Easier Lambda Expressions

#71
post #58

Earlier quoted context omitted.

Why is it useful for LINQ? I feel like it’s mostly dependent on lambdas and generics.

There are anonymous types for intermediate results in the linq stream. And since they are anonymous types you need the c var keyword when working with the outcome.

….All these years and I’ve never known about Anonymous types. I know about records and dynamic objects. I’m guessing they aren’t used often because I have yet to find them.

Re: New in C# 10: Easier Lambda Expressions

#72

Earlier quoted context omitted.

>.NET Core has obviously changed the game but other platforms are still treated second class to Windows in many ways. Not really. Maybe a tiny little bit, but not really. Microsoft has discovered that the "other platforms" are very important, because they want to sell Azure, and people there will use linux predominantly. Same as MS invested heavily in WSL to support "linux" workflows. dotnet on linux might not be com…

> Microsoft has discovered that the "other platforms" are very important Very important to be able to run applications, not to develop them. I spent a few years doing dotnet development on Linux and have had enough of it (so I'm moving away to JVM which looks more and more interesting as long-term research projects and some language improvements land). It is very much a second class citizen. They still want to force…

This hasn't been my experience tbh. Sure, VS doesn't exist on Linux, but VS isn't the best .NET dev environment (even with Resharper), Jetbrains' Rider is, and I haven't felt like the experience is any different on Linux, compared to Windows. The command line tooling introduced with .NET Core is excellent, I usually prefer it to clicking around in a GUI, and it works perfectly on Linux. VS Code also has full .NET support, and uses the same autocomplete engine as VS does. Imo it's not as good as Rider, but not worse than the support for other languages, like Go where it's my go-to editor.

Re: New in C# 10: Easier Lambda Expressions

#73

A couple decades ago everyone was on static types. But then people got sick of the boilerplate, and in what I think was a backlash, dynamic languages like JavaScript, Python, Ruby, etc. took the world by storm. With the raised bar of developer expectations when it comes to agility, static type systems were forced to innovate, and now type-inference and related features are coming to all static languages and bringing…

Exactly my experience. Coming from C# around year 2014s to php then nodejs (due to company setup), typescript is the best of both worlds. Won't be back to static typing for a while unless I'll need higher precision and higher reliability module.

Damn, I’m missing Union Types in C# so much! Typescript make it so simple to compose types.

Re: New in C# 10: Easier Lambda Expressions

#74

Earlier quoted context omitted.

>.NET Core has obviously changed the game but other platforms are still treated second class to Windows in many ways. Not really. Maybe a tiny little bit, but not really. Microsoft has discovered that the "other platforms" are very important, because they want to sell Azure, and people there will use linux predominantly. Same as MS invested heavily in WSL to support "linux" workflows. dotnet on linux might not be com…

> Microsoft has discovered that the "other platforms" are very important Very important to be able to run applications, not to develop them. I spent a few years doing dotnet development on Linux and have had enough of it (so I'm moving away to JVM which looks more and more interesting as long-term research projects and some language improvements land). It is very much a second class citizen. They still want to force…

Would you mind going more into details? Jetbrain’s IDE + dotnet CLI offers a very compelling experience on both macOS and Linux.

Re: New in C# 10: Easier Lambda Expressions

#76

A couple decades ago everyone was on static types. But then people got sick of the boilerplate, and in what I think was a backlash, dynamic languages like JavaScript, Python, Ruby, etc. took the world by storm. With the raised bar of developer expectations when it comes to agility, static type systems were forced to innovate, and now type-inference and related features are coming to all static languages and bringing…

Haskell has been quietly doing this since the 90s though. I guess being a research-first language it isn’t held back by trying to have mass appeal (eg to be C-like to be familiar)

Re: New in C# 10: Easier Lambda Expressions

#77

C# 10 didn't introduce many new features. I hate they delayed the introduction of Algebraic Data Types again. Maybe they will appear in C# 11. Using ADT in F# makes it a breeze to do domain modeling.

C#10 brings some nice quality of life, which is always welcomed. Not all releases have to be about huge changes.

For example file scoped namespace is a very simple but great change, improvement for lambdas, improvement for structs, all of this make it nicer and simpler to write readable code.

Edit: I would also love to see ADT in C#!

Re: New in C# 10: Easier Lambda Expressions

#78
If you haven’t yet, check out the C#10 blog post, it has details covering all the changes: https://devblogs.microsoft.com/dotnet/welcome-to-csharp-10/.

This version brings quality of life changes that make it simpler and nicer to write readable code, which is great to see IMHO.

Re: New in C# 10: Easier Lambda Expressions

#79

Earlier quoted context omitted.

Is F# still moving forward? I am tempted to try it but I don’t want to bet on another tool MS may abandon soon like they did with the .NET frameworks.

Here's the blog post JUST for the changes in the newest release. It is surprisingly meaty for being something other than c# https://devblogs.microsoft.com/dotnet/whats-new-in-fsharp-6/

I love how detailed those blog posts are. Always a (very long) delight to read :)

Re: New in C# 10: Easier Lambda Expressions

#80
post #64

Earlier quoted context omitted.

Static type systems with global type inference haven't had this problem since the beginning (for example OCaml, right around the time Java came out). However, for some obscure reasons the shittier the technology, the more chances it has at becoming popular. Try Elm as a simple example (can be done in a weekend), it'll probably blow your mind. You don't have to write type annotations at all, but the compiler complains…

Local inference is a gift sent from heaven, global inference not so much. Reading OCAML (and F#) is exhausting because you have to look into the implementation of each function (or into a separate interface file) to figure out how it's supposed to be called and what it is going to return.

That's what your IDE or LSP is for.

That's also the difference in 'philosophy' between OCaml, F# and Haskell. Haskell has the 'same' global type inference but the community sees them as (often only ;) documentation.

Post reply on HN