Is LINQ (or linq) a niche tool, or is it on the path to becoming fundamental?

After reading โ€œ What is the Java equivalent of LINQ ? , I would like to know if there is a (lowercase) language, integrated query โ€” in other words, the ability to use concise syntax to execute queries on collections of objects or external stores โ€” will the future path for most languages โ€‹โ€‹be common destination? Or is LINQ an interesting technology that will remain limited for Microsoft languages? Something in between?

EDIT . I do not know other languages, but as I study, it seems that LINQ is neither unprecedented, nor unique. The ideas in LINQ - lambdas and queries - are present in other languages, and the ideas seem to be spreading.

+7
java python linq
source share
8 answers

Before LinQ, Python had Generator Expressions , which are specific syntax for querying collections. Python syntax is more limited than Linq, but allows you to basically perform the same queries as simple ones like in linq. A few months ago I wrote a blog post comparing requests in C # and Python , here is a small example:

C # Linq:

var orders = from c in customers where c.Region == "WA" from o in c.Orders where o.OrderDate >= cutoffDate select new {c.CustomerID, o.OrderID}; 

Python Generator Expressions:

 orders = ( (c.customer_id, o.order_id) for c in customers if c.region == 'WA' for o in c.orders if o.date >= cutoff_date) 

Query syntax in programming languages โ€‹โ€‹is an extremely useful tool. I believe that every language should include something like that.

+6
source share

After spending years

  • Access to the database for working with weapons (in many languages)
  • Transition to Entity Infrastructure
  • Receiving and storing data through the fashionable ORM of the month

There was a time, once made easy access and language integrated way to talk to the database. LINQ to SQL was supposed to be done many years ago. I welcome the team that came up with this - finally, a database that makes sense.

This is not ideal, but my main headache at the moment is there is no real LINQ2SQL support for other shared databases, and there is nothing like it for Java.

(LINQ is generally good too, not just LINQ to SQL :-)

+4
source share

I would say that integrated query technology in any language will become fundamental in time, especially given the recent increase in interest in functional programming languages.

LINQ is by far one of the biggest reasons I personally stick with .NET. In any case, for me it has become fundamental, and I would put so many developers who also feel that way.

+2
source share

I think the functional concepts that underlie LINQ will become popular in many languages. Passing a sequence of objects through a set of functions to obtain the desired set of objects. Essentially using lambda syntax over query syntax.

This is a very powerful and expressive way of coding.

This is not because I consider this a fundamentally better way to do something (i.e. lambda over the query syntax). Comparatively speaking, it is much easier to add basic library support for query language expressions than to add query syntax. All that is required is the lambda syntax for queries -

  • Lambda
  • Basic query methods

Most new languages โ€‹โ€‹support lambdas (even C ++ finally gets them!). Adding library support is fairly cheap and can usually be done by a motivated person.

Getting the syntax of a query into a language, but requires a lot more work.

+2
source share

Disclaimer: I have never used LINQ. Please correct me if I am wrong.

Many languages โ€‹โ€‹have constructs that allow you to use the same functions as LINQ with language data types. Apparently, the most interesting feature is that LINQ constructs can be converted to SQL, but this does not apply to LINQ: http://www.aminus.org/blogs/index.php/2008/04/22/linq- in-python? blog = 2 .

+1
source share

I don't think linq will be limited to Microsoft languages, check it out, there is already something for php, check it out http://phplinq.codeplex.com/

I think that Linq is a great tool in the development process, and I personally will be very happy if it is ported to other languages โ€‹โ€‹(for example, in my php example)

+1
source share

I do not think that you really can classify it (or much more). Although Iโ€™m unlikely to say that LINQ is a niche tool - it has many applications for many people - this is not a "fundamental" IMO. However, I would also not say that using the LINQ (or equivalent) query language in the language can be truly fundamental at this stage of the game. In the future, it is possible, but now you can build a query in different ways, which gives significantly different levels of performance.

0
source share

Sounds a lot to me like Ruby Active Record, but I never used LINQ. Has anyone used both? (I would post it as a comment, but I would really like to be updated in response - I'm probably wrong, so it will be underestimated :))

(Actually, I have to say that AR is similar to LINQ to SQL, they did not implement AR for other purposes, as far as I know)

0
source share

All Articles