Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What about C#? Have you guys considered the .net framework?



I am mainly a dotnet developer but even I think that if you already have a team full of Java developers there is little to gain from switching to C#. Just the effort of learning a completely new set of libraries and frameworks would give me pause.


C# seems to be the pick for those programmed in microsoft ecosystem in the past, it's not attractive for beginners or non-microsoft-ecosystem developers per se, esp in this cloud and internet era.


I’m dumbfounded that anyone would believe that C# is not attractive for cloud development - Microsoft’s platform or otherwise. C# is a fantastic language and dotnet is a great, modern platform. IMO c# is a tad more beginner friendly than Java.


Also any time I have to use Java I'm always trying to use LINQ before I remember that's a C# feature. C# is really solid, especially .NET Core 3.1 and later.


Same for me. I use LINQ extensively and can't imagine without it.



* This other JVM language has it too. Groovy is not Java.

Java does "have it," as in Java has streams. It's pretty crappy compared to Linq due to language limitations but it's a lot better than nothing.


> [streams are] pretty crappy compared to Linq

I think that's unfair to the Streams API. It wasn't intended to solve the same problem as Linq and the problem it does solve it does very well. Streams transform collections. Streams API statements are usually elegant and the party piece of Streams is concurrency with parallelStream(), which will distribute stream operations across threads safely and transparently.

Perhaps java should have a Linq equivalent, but the fact that the Streams API isn't that isn't actually a knock on Streams. In the meantime there is JOOQ and others that deliver elegant query syntax with compile time type safety.


This sounds like a pretty serious misunderstanding of what LINQ is. LINQ is a general query capability of which there are multiple providers - one of them is for SQL, which may be what you are thinking LINQ is, but another is for in-memory enumerables ("LINQ to Objects"). LINQ to Objects and Java Streams actually are intended to solve the exact same problem.

If you think Streams API statements are elegant compared to LINQ, I again don't think you are familiar with LINQ. C# has language features Java does not have which usually makes LINQ much more succinct. For example, imagine a list of order items where each item has a double "Price" property. If you want to sum the price of all the items, here's how you'd do it in C# vs Java:

C#: double sum = items.Sum(item => item.Price);

Java: double sum = items.stream().mapToDouble(Item::getPrice).sum();

Java lacks extension methods, so stream() must first be called to get at any stream methods. Worse, Java has generic type erasure, so I have to to call "mapToDouble" to get this hacky concoction called a "DoubleStream" which actually has the sum method.

Not the end of the world, for sure, but definitely crappy compared to LINQ. There are lots of other irritating problems, such as Stream itself not being enumerable and the need for calling collect with a Collector.


Does it have the List.Where().Select() syntax instead of the select n from list where syntax? All of the examples on that page seem to be the latter.


Read the authors argument why they don't use Kotlin, a better language is not always nicer, especially when you risk being left behind. That is the reason why I don't touch C#.

Java has a massive community and a community that shares knowledge. This is what makes Java the greatest tool for any business.


> it's not attractive for beginners or non-microsoft-ecosystem developers per se, esp in this cloud and internet era

Spoken like its 2002!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: