score:8
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 :-)
Source: stackoverflow.com
Related Query
- Is LINQ (or linq) a niche tool, or is it on the path to becoming foundational?
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- Does this LINQ code perform multiple lookups on the original data?
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- What is the equivalent of XML PATH and Stuff in Linq lambda expression (GROUP_CONCAT/STRING_AGG)?
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- Left outer join using LINQ -- understanding the code
- How does linq actually execute the code to retrieve data from the data source?
- LINQ Source Code Available
- Refactor Linq code and "LINQ to Entities does not recognize the method"
- How can I write the following code more elegantly using LINQ query syntax?
- How to code the partial extensions that Linq to SQL autogenerates?
- Determine the source DataContext for a Linq to Sql query
- creating Linq to sqlite dbml from DbLinq source code
- Understanding the various options for runtime code generation in C# (Roslyn, CodeDom, Linq Expressions, ...?)
- How to swap the data source associated with a Linq query?
- code first approach error: the specified type member 'yyyxx' is not supported in linq to entities
- How to write this code using the Linq Extension Method-Syntax?
- How can I check the number of calls to the database in LINQ query when using .NET Core and Code First?
- Cannot build the Test project for LINQ IQueryable Toolkit (IQToolkit) - Code 9009
- How do I determine the source of unpredictable LINQ query results?
- Can I use a LINQ IEnumerable result as the data source for a Gtk.TreeView?
- Why the extension method of where for LINQ in this code would print out a single number while it shouldn't print anything at all?
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- How to simplify the code Using LINQ
- The source contains no DataRows using Linq
- Reduce the line of code for this LINQ query
- source code for LINQ 101 samples
- Can I Use The Same Linq Code to Query for Different Conditions?
More Query from same tag
- Lambda or LINQ for result
- Loading data from XML Document throwing a NullReferenceException when using XDocument on Windows Phone 7
- Linq search on array of object
- DataTemplate to Linq
- Refactor LINQ method to introduce Lamba function as a parameter
- Simplifying my Linq query and union
- Lookup elements in Hash where the key is composed of two values
- Complex query with if
- Generic delete and update using Entity Framework
- Nested Linq in MVC4 Razor
- How to get a sum of children values on one LINQ
- Dynamic LINQ with Data Objects
- Difficulty appending to XML file using Linq
- LINQ to SQL and Concurrency Issues
- Cannot initialize type "x" with a collection initializer because it does not implement 'System.Collections.IEnumerable'
- Extending data context classes (interface, new properties etc)
- Hierarchical structure iteration and LINQ
- What is the preferred way to interact with WMI using LINQ
- List<string[]> determine max length by Linq
- Where is the DefaultIfEmpty with the linq query style
- Datatable.select doesn't return all columns in the main data table
- Remove objects with duplicate properties from List
- Read duplicate datarows from database into business objects and distinct them using LINQ
- Linq query WHERE one field is >= another field in parent table?
- Using LINQ, select list of objects inside another list of objects
- Updating a list using Linq
- Is there a way to fill a collection using a LINQ expression?
- How to combine / merge two StringCollection into one in C#
- Nhibernate 3.3.1 OpenEdge dialect generates bad like statement from Linq
- WCF Interface not Implemented