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 at build time if the same function is called with two different types in two places.
The reasons are simple: it's promoted by a big company. Same reason why C# and Go are popular.
Won't be back to static typing for a while unless I'll need higher precision and higher reliability module.
The funny .. or sad.. part is that the c#9 explicit ~verbose style would have been the only one accepted before. If you wrote implicitely typed variables people would get angry (I think there are many online articles about how java 9 `var` was bad)
It can be both. Type inference isn't a brand-new idea, but it still takes work to diffuse it into mainstream, practical languages, especially retrofitting it onto existing languages that weren't designed for it. That still counts as innovation in my book.
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.
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.
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.
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.
The F# style is enabled by a set of features - some of which would be really hard to add to C# (such as currying and global type inference) - but even if they were added, the millions(?) of C# developers would be unlikely adopt the functional style just because it was possible. A language is not just a list of features; each language has its own culture and "idiomatic" way of doing things.
https://devblogs.microsoft.com/dotnet/whats-new-in-fsharp-6/
Java had two tech advantages over C#: It officially ran on platforms other than Windows and ran well, and their JVM was far ahead of the MS CLR.
Both of these things went away/are going away.
What really remains is Java's reputation over "Embrace, Extend, Extinguish Microsoft" (tho Oracle has been busy trying to destroy Java's reputation ever since they bought Sun) and the larger eco-system/community/existing code bases and sunk costs.
That's all of no use to me (I don't work on projects like that), but let's not just shove that aside.
I also don't really agree with this:
> look and wait and do a half-assed implementation of a lot of tried-and-true C# language features some years later
Loom looks like a much more interesting approach compared to async/await hell (I've done it enough to know). I like records and upcoming "withers" much more than { get; set; } (which is easy to write but promotes shit code) because of their focus on immutability. (Yes, I am aware of { get; } and recently introduced { get; init; }, it doesn't really help with the thing withers are trying to solve — copying most fields while replacing one or two values, keeping both the old and the new value immutable). LINQ? maybe, I miss expression trees in Java.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.
I do wonder what was limiting them before
Heck, I'd say, by now with local functions most lambdas that previously would have been a local could now just be a local function.
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.
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#!
https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
Lambdas can also have attributes now, too.
This version brings quality of life changes that make it simpler and nicer to write readable code, which is great to see IMHO.