score:8

Accepted answer

before linq, python had generator expressions which are specific syntax for performing queries over collections. python's syntax is more reduced than linq's, but let you basically perform the same queries as easy as in linq. months ago, i wrote a blog post comparing queries 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)

syntax for queries in programming languages are an extremely useful tool. i believe every language should include something like that.

score:0

i don't think that you can really classify it (or many things) as either. while i would hardly say that linq is a niche tool -- it has many applications to many people -- it's not "foundational" imo. however, i also wouldn't say that having linq (or an equivalent) language-specific querying language can be truly foundational at this stage of the game. in the future, perhaps, but right now you can construct a query in many different ways that yield significantly varying levels of performance.

score:0

it sounds a lot to me like ruby's active record, but i've never used linq. anyone used both? (i would have posted this as a comment, but i'd really like to be updated on the answer--i'm probably wrong so it'll get downvoted :) )

(actually i should say that ar is like linq to sql, they haven't implemented ar for other targets as far as i know)

score:1

disclaimer: i've never used linq. please correct me if i'm wrong.

many languages have constructs which allow to the same things as linq with the language data types. apparently the most interesting feature is that linq constructs can be converted to sql, but it's not specific to linq: http://www.aminus.org/blogs/index.php/2008/04/22/linq-in-python?blog=2.

score:1

i don't think linq will be confined to the microsoft languages, check it out, there is already something for the php, check it out http://phplinq.codeplex.com/

i think linq is great tool in development process and personally would be really glad if it will be transferred to other languages(like in my example of php)

score:2

i would say that integrated query technology in any language will become foundational in time, especially given the recent rise in interest of functional programming languages.

linq is certainly one of the biggest reasons i personally am sticking with .net, anyway - it's become foundational for me personally, and i'd wager a lot of devs feel this way as well.

score:2

i think the functional concepts which are the under pinnings of linq will become popular in many languages. passing a sequence of objects through a set of functions to get the desired set of objects. essentially, using the lambda syntax over the query syntax.

this is a very powerful and expressive way of coding.

this is not because i feel it's a fundamentally better way to do things (i.e. lambda over query syntax). comparatively speaking, it's much easier to add the underlying library support for query expressions to a language than it is to add the query syntax. all that is required the lambda syntax for queries is

  • lambdas
  • underlying query methods

most new languages support lambdas (even c++ is finally getting them!). adding the library support is fairly cheap and can usually be done by a motivated individual.

getting the query syntax into the language though requires a lot more work.

score:4

after spending years

  • handcrafting database access(in oh so many languages)
  • going throgh the entity framework
  • fetching and storing data through the fashioned orm of the month

it was about time somone made an easy to access and language integrated way to talk to a database. linq to sql should have been made years ago. i applaud the team that come up with it - finally a database access framework that makes sense.

it's not perfect, yet, and my main headache at the moment is there's no real support for linq2sql for other common databases, nor are there anything like it for java.

(linq in general is nice too btw, not just linq to sql :-)


Related Query

More Query from same tag