Live data from Hacker News

New in C# 10: Easier Lambda Expressions

dontcodetired.com

61–70 of 111 posts

Re: New in C# 10: Easier Lambda Expressions

#61
post #32

Earlier quoted context omitted.

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.

You are missing the part where Java's clone done by Microsoft, J++ already had those features, and it was the first project Anders worked at Microsoft, hence it also has the property/event ideas from Delphi, and a framework that was the predecessor of Windows Forms.

These were the major pain points for the Java lawsuit that Sun did against Microsoft.

The irony with all these attempts to make COM easier to use is that they always fail flat when the Windows dev team has their turn, and then they undo everything and we are back into C++ and IDL land (latest version of it, C++/WinRT).

Re: New in C# 10: Easier Lambda Expressions

#62
post #25
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.

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

Which Java?

OpenJDK, GraalVM, Open J9, Aicas, PTC, microEJ, Azul, Amazon,....

Re: New in C# 10: Easier Lambda Expressions

#63

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

Ever since LINQ, maybe even before that, I feel Java is a more boring C# clone. C# keeps innovating their language (borrowing a lot of times from other languages, of course), and then java seems to look and wait and do a half-assed implementation of a lot of tried-and-true C# language features some years later. Java had two tech advantages over C#: It officially ran on platforms other than Windows and ran well, and t…

Had Oracle not bought Sun, Java would have died in version 6, and MaximeVM would never had become GraalVM.

There weren't other buyers in town, besides IBM, which I probably would have managed it just as Oracle has, given that the trio have been around in Java world since the early days.

Re: New in C# 10: Easier Lambda Expressions

#64

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…

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.

Re: New in C# 10: Easier Lambda Expressions

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

My IDE puts annotations on every function and I can hover over values. Typing them out seems pointless with the right tooling.

Re: New in C# 10: Easier Lambda Expressions

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

One could argue that this is better covered by IDE/tooling showing you inferred types / suggestions.

Re: New in C# 10: Easier Lambda Expressions

#68

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…

C# has type inference since a very long time ago.

Re: New in C# 10: Easier Lambda Expressions

#69
post #44

Earlier quoted context omitted.

Personally I think reflection is the devil and the reason why we can’t abandon VMs for native compilers.

Reflection does away the need to manually implement serializers. In a growing codebase where data models transform and references to those models begin to rot, that is incredibly useful.

That can be done with code generation at compile time. We don’t need to reflect at runtime for that.

Re: New in C# 10: Easier Lambda Expressions

#70

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.

Yes. F# 6 was just released with .NET 6 and Visual Studio 2022. It's an awesome language with a vibrant community. Plus, it's fully open source and cross-platform, so if MS were to abandon it, I think it could carry on anyway.

I think the real question to ask is how it would fare without Don :)
Post reply on HN