There's something clearly wrong with the code samples: look at the "closing tags" which somehow sneaked in in line 17 of the first sample
Yeah, I tried those out in a scratch pad. They don't compile.
New in C# 10: Easier Lambda Expressions
11–20 of 111 posts
Re: New in C# 10: Easier Lambda Expressions
#12Re: New in C# 10: Easier Lambda Expressions
#13Re: New in C# 10: Easier Lambda Expressions
#14With this the language gets a little more beautiful. On a related note, I just switched from a C# job at Microsoft (microservices) and moved to a Java shop where we're all really just starting to learn Kotlin and migrate our work there. I'm shocked how many times we've learned a fancy feature and I get to say, "actually, C# has something just like this too." (i.e. operator overloading) It is a surprisingly modern lan…
Having worked recently in it, I found Java to be relatively (as a language, not for tooling) backwards compared to C#.
Re: New in C# 10: Easier Lambda Expressions
#15With this the language gets a little more beautiful. On a related note, I just switched from a C# job at Microsoft (microservices) and moved to a Java shop where we're all really just starting to learn Kotlin and migrate our work there. I'm shocked how many times we've learned a fancy feature and I get to say, "actually, C# has something just like this too." (i.e. operator overloading) It is a surprisingly modern lan…
Err.. I'm too drunk to check, bit I'm fairly sure C# has had operator overloading for like ten years? Having worked recently in it, I found Java to be relatively (as a language, not for tooling) backwards compared to C#.
Every generation must learn this for themselves though.
Re: New in C# 10: Easier Lambda Expressions
#16F# is really, really bleeding into C#. There'll be a convergence, for all intents and purposes, by about C# 15 at this rate.
Ehhh, not really. It really depends on what you mean by convergence. You could add every single one of F#'s features into C#, and I still wouldn't consider them to be same language or the other to be irrelevant. The strength of F# is the primary coding style: mostly functional, mostly immutable, expression-based, strongly typed with global type inference. The way most C# is written is almost the polar opposite: mostl…
Re: New in C# 10: Easier Lambda Expressions
#17Nice, I like it. I do wonder what was limiting them before
Every feature starts out with -100 points. So there's always a trade-off to do everything you can imagine to make every last corner case nice or shipping something in a reasonable timeframe. When lambda expressions were introduced they were designed to work well together with LINQ and that whole part of the language isn't a small one either. Storing a lambda expression in a local variable is not such a common occurre…
Re: New in C# 10: Easier Lambda Expressions
#18With this the language gets a little more beautiful. On a related note, I just switched from a C# job at Microsoft (microservices) and moved to a Java shop where we're all really just starting to learn Kotlin and migrate our work there. I'm shocked how many times we've learned a fancy feature and I get to say, "actually, C# has something just like this too." (i.e. operator overloading) It is a surprisingly modern lan…
You’re also likely to discover that while C# the language is amazing, the CLR runtime looks frankly minor league when compared to the JVM.
Re: New in C# 10: Easier Lambda Expressions
#19Earlier quoted context omitted.
Err.. I'm too drunk to check, bit I'm fairly sure C# has had operator overloading for like ten years? Having worked recently in it, I found Java to be relatively (as a language, not for tooling) backwards compared to C#.
C++ had operator overloading in the 90s. Mostly we decided it was a bad idea. Every generation must learn this for themselves though.
The language kind of put itself into a corner when what C# calls `MoveNext` is called `++` (with two variants of course) and what C# calls `Current` is called `*`. Taking what mathematically worked for iterating an array and taking it piecemeal to define your syntax is the kind of operator overloading that is a bad idea.
Re: New in C# 10: Easier Lambda Expressions
#20Earlier quoted context omitted.
Err.. I'm too drunk to check, bit I'm fairly sure C# has had operator overloading for like ten years? Having worked recently in it, I found Java to be relatively (as a language, not for tooling) backwards compared to C#.
C++ had operator overloading in the 90s. Mostly we decided it was a bad idea. Every generation must learn this for themselves though.