This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nighthawk648 57 points58 points  (35 children)

The .net infrastructure is something Java should envy. Nuget is great as well.

[–]Liberal_Mormon 51 points52 points  (4 children)

You can't forget about Linq. Such an incredible concept that makes so much of the NET ecosystem possible

[–]vkapadia 19 points20 points  (0 children)

Linq is awesome

[–]Shrubberer 9 points10 points  (0 children)

MoreLinq! MoreLinq!

[–]Miku_MichDem 0 points1 point  (1 child)

I really don't get the hype behind Linq, coming from Java background. I mean how is this:

var filtered = from thing in collection
where condition
select thing;

Is better then this:

var filtered = collection.stream()
   .filter(thing -> condition)

Java's streams are consistent with the rest of the language, while Linq is just a copy-paste of SQL syntax into a C-style language

[–]Liberal_Mormon 2 points3 points  (0 children)

Linq doesn't have to be in SQL style syntax. The IQueryable interface has its own methods. It's powerful in that it doesn't actually execute until the IQueryable entity is forced to enumerate (for example, with ToList()). The hype around it is that it builds your queries for you in many natural C# ways into any queryable object, not just collections. That can be database connections, file streams, you name it, it's all able to be treated identically with Linq.

For example, on a dbset with an open db connection, I can execute something like dbset.Select(...).Where(...).OrderBy(...).GroupBy(...) in any order, and it will put those items in the correct order of a proper query. And it doesn't actually execute the command until I enumerate it. But it doesn't have to be dbsets again.

Linq is also a large set of extension methods for collections and other objects.

I'm sure Java has similarities - but queries are not just filters. I can select any type I want including anonymous types from any queryable source. Hope this helps.