←back to thread

201 points olvy0 | 1 comments | | HN request time: 0.204s | source
Show context
high_na_euv ◴[] No.41878416[source]
LINQ is so fucking useful and well designed feature of .NET ecosystem that it is unreal when you gotta use lang which doesnt have such a thing.

C# design team is/was unparalleled

replies(7): >>41878459 #>>41878543 #>>41878588 #>>41878686 #>>41879163 #>>41879194 #>>41879315 #
pjmlp ◴[] No.41878459[source]
LINQ is largely based on FP stuff, also how Smalltalk collections work.

It is relatively easy to find similar capabilities in most languages nowadays, unless one is stuck on Go, C and similar.

replies(7): >>41878547 #>>41878579 #>>41878702 #>>41878783 #>>41878792 #>>41878816 #>>41879057 #
apwell23 ◴[] No.41878702[source]
No it isn't easy to find similar capabitites in java, go, python, ruby.

Maybe you do simulate some of this using meta programming in ruby but its certainly not 'easy to find'.

replies(2): >>41878746 #>>41879346 #
pjmlp ◴[] No.41878746[source]
It certainly is, unless you are talking about SQL like syntax, which is basically syntax sugar for classical FP.

And I explicitly left Go out of my list.

replies(1): >>41878887 #
apwell23 ◴[] No.41878887[source]
>unless you are talking about SQL like syntax

yes thats what linq is?

https://learn.microsoft.com/en-us/dotnet/csharp/linq/

"Language-Integrated Query (LINQ) is the name for a set of technologies based on the integration of query capabilities directly into the C# language." With LINQ, a query is a first-class language construct, just like classes, methods, and events.

doing this in java is not LINQ imo

  List<Integer> lowNums = filter(toList(numbers), new 
  Predicate<Integer>() {
        @Override
        public boolean apply(Integer n) {
            return n < 5;
        }
    });
replies(5): >>41879130 #>>41879238 #>>41879328 #>>41879460 #>>41879995 #
SideburnsOfDoom ◴[] No.41879460[source]
> yes thats what linq is?

The link that you gave says "LINQ is the name for a set of technologies" which includes the "SQL like syntax".

Includes is not the same as "is".

It isn't the most often used part of LINQ.

replies(1): >>41879503 #
apwell23 ◴[] No.41879503[source]
sure but you cannot just remove 'sql like syntax' and claim you can do linq in any language.
replies(1): >>41886462 #
1. SideburnsOfDoom ◴[] No.41886462[source]
You can in fact ignore "sql like syntax" and find "similar capabilities" in many other languages. After all, most C# coders ignore the "SQL like syntax" in C# itself.

And when languages imitate features of a different language, they tend to go for the features that people like and use. No-one is going to add "similar capabilities" to the feature that no-one wants in the first place. People who say "C#'s LINQ is awesome!" just aren't talking about "sql like syntax", and people who say "without sql like syntax it's just not on the same level as LINQ" are misguided.