Live data from Hacker News

New in C# 10: Easier Lambda Expressions

dontcodetired.com

31–40 of 111 posts

Re: New in C# 10: Easier Lambda Expressions

#31
post #12

With 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#.

I think that's what the poster you're replying to is saying.

Re: New in C# 10: Easier Lambda Expressions

#32

Earlier 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.

People don't appreciate how much of an impact C++ had on C#. People consider it a Java clone, but the first version had many features to support a large segment of C++ (COM) developers that Microsoft wanted to move to .NET. This brought a visible performance hubbub at the time which was often instigated by the folks more comfortable with C++, manual memory management, etc.

Re: New in C# 10: Easier Lambda Expressions

#33
post #18

Earlier quoted context omitted.

You’re going to love Kotlin, it really is a fantastic pragmatic language. 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.

What is better in the JVM?

The ecosystem.

Re: New in C# 10: Easier Lambda Expressions

#34
post #28

Earlier quoted context omitted.

What is better in the JVM?

I think both have different pros. Java has higher peak JIT performance though after Rosalyn was introduced C# has made strides at closing that gap on many metrics. GC algorithms are more advanced, namely ZGC and Shenandoah. I would elaborate but I don't want to turn this post into an actual essay. JVM is more configurable. This is a double edged sword, it heavily favors users that have spent the time to really unders…

[deleted]

Re: New in C# 10: Easier Lambda Expressions

#35
post #29
post #25

Earlier quoted context omitted.

> the CLR runtime looks frankly minor league when compared to the JVM. This is comically backwards from my experience. I often see near-native optimized performance on C#/CLR, where I see similar code (SIMD friendly loops) literally hundreds if not thousands of times slower than it should be in Java.

See my longer reply but I think this basically comes down to it being much easier to write fast C#. Generally if you are experienced enough with Java you can make it do what you want and get to the same performance (or higher) with Java but it's definitely not as easy and I do think this is a serious downside to Java.

[deleted]

Re: New in C# 10: Easier Lambda Expressions

#36

I love watching C# slowly grow from a boring MS Java clone into something elegant but still useful

I think it's been elegant for a number of years now. Pretty much ever since Linq became usable.

Yeah, lambdas and reflection really.

Re: New in C# 10: Easier Lambda Expressions

#37

Earlier 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.

>"Mostly we decided it was a bad idea."

We who? From where I stand people are fine with operator overloading where it makes sense and C++ is far from being the only language with this feature.

Problem comes when shitty programmers get orgasmic about some language feature and try to use it everywhere to everyone's detriment.

Re: New in C# 10: Easier Lambda Expressions

#38
post #12

With 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#.

C# has supported operator overloading since C# 1.0 in 2002. See section 7.2.2 of the original specification.

Re: New in C# 10: Easier Lambda Expressions

#39

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…

I love type inference. Strong typing makes maintenance and refactoring much easier and with type inference the code looks very good.

I still remember how ugly and tedious STL iterators were in C++. Now it’s just “auto”. LINQ also wouldn’t work without type inference.

Re: New in C# 10: Easier Lambda Expressions

#40
post #31

Earlier 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#.

I think that's what the poster you're replying to is saying.

No, the reply raises a valid issue. I was implying that op overloading was a modern thing, but it's apparently been around for a very long time, and doesn't seem to be the best example of a "modern" feature of languages.
Post reply on HN