Advantages & Disadvantages of LINQ
-
Sunday, August 29, 2010 1:39 PMWhat are the advantages of using LINQ and disadvantages of LINQ.
- Moved by edhickey Monday, August 30, 2010 3:22 PM (From:.NET 3.0/3.5 Windows Workflow Foundation)
All Replies
-
Monday, August 30, 2010 7:20 PM
My List
Advantages
- Quick turn around for development
- Queries can be dynamically
- Tables are automatically created into class
- Columns are automatically created into properties
- Relationship are automatically appeaded to classes
- Lambda expressions are awesome
- Data is easy to setup and use
Disadvantages
- No clear outline for Tiers
- No good way of view permissions
- Small data sets will take longer to build the query than execute
- There is an overhead for creating queries
- When queries are moved from sql to application side, joins are very slow
- DBML concurrency issues
- Hard to understand advance queries using Expressions
I found that programmers used to Sql will have a hard time figuring out the tricks with LINQ. But programmers with Sql knowledge, but haven't done a ton of work with it, will pick up linq quicker.
I was writing linq before I took a Sql class in college, linq was alot simplier. Same with an current intern. The experienced programmers need to learn a new syntax, that used to be standard.
- Edited by LitEnders Monday, August 30, 2010 7:30 PM added experence thoughts
- Edited by LitEnders Tuesday, August 31, 2010 1:42 PM Changed Rows to Columns
- Marked As Answer by Michael Sun [MSFT]Microsoft Employee, Moderator Thursday, September 09, 2010 1:26 AM
-
Tuesday, August 31, 2010 7:54 AM
In addition to Litenders' comprehensive list, I justified the use of LINQ-to-SQL to my boss based on it's strong data-typing and speed of development for C# programmers who are not really database programmers. It is also very geared towards web-development with its optimistic locking approach: that can save a whack of development effort.
However I still needed to write some stored procedures for the more complex actions and found locking, serialization and transaction management less than intuitive for the complex code which I chose to write in LINQ. Also there are both pros and cons in terms of performance (see http://social.msdn.microsoft.com/Forums/en-US/linqprojectgeneral/thread/3712aa37-d946-40ed-b72f-8f67a35709de ).
Finally, though, LINQ does seem to cope with just about anything and the troubles I had were helped along by the good folk of this forum.
- Marked As Answer by Michael Sun [MSFT]Microsoft Employee, Moderator Thursday, September 09, 2010 1:26 AM
-
Tuesday, August 31, 2010 1:22 PM
John and LitEnders have given good advice.
To that I will add this
I'm by no means an sql or a linq expert, I use them both.
There is a trend to either make linq into something bad or a silver bullet depending on what side are you.
You need to seriosly consider your project requirements in order to choose. The choice is not mutually exclusive. Take what is good from them both .
If you need anything else do not hesitate to ask, doubt is a sign of intelligence not ignorance. Remember: "Dubito ergo cogito ergo sum".
Regards
- Marked As Answer by Michael Sun [MSFT]Microsoft Employee, Moderator Thursday, September 09, 2010 1:26 AM
-
Tuesday, August 31, 2010 1:35 PM
You need to seriosly consider your project requirements in order to choose. The choice is not mutually exclusive. Take what is good from them both .
Sage advice, Serguey! -
Tuesday, August 31, 2010 1:43 PMIs there something your Comparing it to? Such as ADO.Net or MySql & Java.

