LINQ to Entities
-
do you really use it ? why i need to learn new syntax to get lower performance ? when i have no time and the high performance is not a must i go for the Dataset. its ok with the collections and arrays but with the database !! what do you think ? regardless that i am late to ask this :D
-
do you really use it ? why i need to learn new syntax to get lower performance ? when i have no time and the high performance is not a must i go for the Dataset. its ok with the collections and arrays but with the database !! what do you think ? regardless that i am late to ask this :D
Tamimi - Code wrote:
why i need to learn new syntax to get lower performance ?
Who says the performance is lower? A well designed entity query can be as performant as a hand designed SQL query. You don't need to use the new syntax - it's entirely up to you. Linq2Entities does not replace ADO.NET; it's just another tool in your arsenal. Use it, or not; that's entirely up to you.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Tamimi - Code wrote:
why i need to learn new syntax to get lower performance ?
Who says the performance is lower? A well designed entity query can be as performant as a hand designed SQL query. You don't need to use the new syntax - it's entirely up to you. Linq2Entities does not replace ADO.NET; it's just another tool in your arsenal. Use it, or not; that's entirely up to you.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
while its not replacing anything and have no performance benefits, why its exist ? i am asking this because the lambda expression is hard :rolleyes: thank you
-
do you really use it ? why i need to learn new syntax to get lower performance ? when i have no time and the high performance is not a must i go for the Dataset. its ok with the collections and arrays but with the database !! what do you think ? regardless that i am late to ask this :D
I like LINQ, it can save a lot of time. Especially if you are using LINQ to SQL. But I really like the simple things such as counting specific values in a list...
int count = list.Count(c => c.Value > 10);
much nicer and quicker than...
int count = 0;
foreach(CustomClass c in list)
{
if(c.Value > 10)
count++;
}Illogical thoughts make me ill
-
I like LINQ, it can save a lot of time. Especially if you are using LINQ to SQL. But I really like the simple things such as counting specific values in a list...
int count = list.Count(c => c.Value > 10);
much nicer and quicker than...
int count = 0;
foreach(CustomClass c in list)
{
if(c.Value > 10)
count++;
}Illogical thoughts make me ill
And what do you think it's doing in the background?
musefan wrote:
it can save a lot of time
Coding time, yes. Maybe not execution time (have you benchmarked it?). Maybe not maintenance time if the next person to touch the code doesn't understand it. I'll stick with simpler code.
-
while its not replacing anything and have no performance benefits, why its exist ? i am asking this because the lambda expression is hard :rolleyes: thank you
It's for lazy people who don't want to type much and want to exhibit their cutting-edge skillz. :-D
-
do you really use it ? why i need to learn new syntax to get lower performance ? when i have no time and the high performance is not a must i go for the Dataset. its ok with the collections and arrays but with the database !! what do you think ? regardless that i am late to ask this :D
Tamimi - Code wrote:
when i have no time and the high performance is not a must i go for the Dataset
That's no reason to use a DataSet... in fact there pretty much is no reason to use a DataSet. "If you don't have time to do it right, when will you have time to do it over?"
-
while its not replacing anything and have no performance benefits, why its exist ? i am asking this because the lambda expression is hard :rolleyes: thank you
It exists to bring database functionality into the realm of coders who may have limited SQL skills, by integrating query capabilities into a language they are comfortable with.
Tamimi - Code wrote:
i am asking this because the lambda expression is hard
That's just being lazy. Lambda expressions are not just for L2E, so you really should learn them.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
And what do you think it's doing in the background?
musefan wrote:
it can save a lot of time
Coding time, yes. Maybe not execution time (have you benchmarked it?). Maybe not maintenance time if the next person to touch the code doesn't understand it. I'll stick with simpler code.
Yes, I did mean quicker to code and I understand that it will be doing a similar if not identical thing in the background. I did just do a test and the foreach loop is around 3 times quicker than the LINQ query (in this case), but for general use I think the faster development time is worth it, and it is better maintenance - if the next person didn't understand then it would become time for them to learn ;) Anyway, if performance became important then there would be a lot more general style coding stripped away I am sure.
Illogical thoughts make me ill
-
Tamimi - Code wrote:
when i have no time and the high performance is not a must i go for the Dataset
That's no reason to use a DataSet... in fact there pretty much is no reason to use a DataSet. "If you don't have time to do it right, when will you have time to do it over?"
PIEBALDconsult wrote:
If you don't have time to do it right, when will you have time to do it over?"
yes, hopefully; maybe just enough to do it differently and wrong again. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
PIEBALDconsult wrote:
If you don't have time to do it right, when will you have time to do it over?"
yes, hopefully; maybe just enough to do it differently and wrong again. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
Until you've fully explored enough of the wrong ways, you'll never truly appreciate the right way. :-D
-
Until you've fully explored enough of the wrong ways, you'll never truly appreciate the right way. :-D
You missed the word "grasshopper" from the end of that sentence.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
And what do you think it's doing in the background?
musefan wrote:
it can save a lot of time
Coding time, yes. Maybe not execution time (have you benchmarked it?). Maybe not maintenance time if the next person to touch the code doesn't understand it. I'll stick with simpler code.
Good point. LINQ is usually slower when I've dabbled with it. And although more verbose I always prefer simple explicit code, less error prone, easier for others to understand and easier to debug.
Regards, Rob Philpott.
-
do you really use it ? why i need to learn new syntax to get lower performance ? when i have no time and the high performance is not a must i go for the Dataset. its ok with the collections and arrays but with the database !! what do you think ? regardless that i am late to ask this :D
I'm only just starting to learn LINQ: I have pretty reasonable SQL abilities already. The main reason I am learning it is that I feel that the stronger typing and compile time syntax checking available in LINQ to SQL has got to produce better, cleaner, more reliable solutions than hand crafted SQL. Once I've got a good feeling for it, I'll make the decision to either go with it or back - but until I have that level of confidence in my abilities with it, I can't make that call. If I don't learn LINQ, I made that call without sufficient information.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
-
do you really use it ? why i need to learn new syntax to get lower performance ? when i have no time and the high performance is not a must i go for the Dataset. its ok with the collections and arrays but with the database !! what do you think ? regardless that i am late to ask this :D
Perhaps you could look here for some information Entity Framework Performance[^]
I know the language. I've read a book. - _Madmatt
-
And what do you think it's doing in the background?
musefan wrote:
it can save a lot of time
Coding time, yes. Maybe not execution time (have you benchmarked it?). Maybe not maintenance time if the next person to touch the code doesn't understand it. I'll stick with simpler code.
PIEBALDconsult wrote:
have you benchmarked it?
Yes, I have. Entity Framework Performance[^]
I know the language. I've read a book. - _Madmatt
-
I'm only just starting to learn LINQ: I have pretty reasonable SQL abilities already. The main reason I am learning it is that I feel that the stronger typing and compile time syntax checking available in LINQ to SQL has got to produce better, cleaner, more reliable solutions than hand crafted SQL. Once I've got a good feeling for it, I'll make the decision to either go with it or back - but until I have that level of confidence in my abilities with it, I can't make that call. If I don't learn LINQ, I made that call without sufficient information.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
OriginalGriff wrote:
If I don't learn LINQ, I made that call without sufficient information.
Hear hear! I finally dabbled in a little bit of Linq (to SQL?) a few weeks ago. It gave me no benefit and I don't see how it can deliver any. Especially considering I use several different database systems, not just Sql Server.
OriginalGriff wrote:
LINQ to SQL has got to produce better, cleaner, more reliable solutions than hand crafted SQL.
Not if you've been hand crafting clean reliable SQL for twenty years. If Linq produces better SQL than you do, then go with it.
-
OriginalGriff wrote:
If I don't learn LINQ, I made that call without sufficient information.
Hear hear! I finally dabbled in a little bit of Linq (to SQL?) a few weeks ago. It gave me no benefit and I don't see how it can deliver any. Especially considering I use several different database systems, not just Sql Server.
OriginalGriff wrote:
LINQ to SQL has got to produce better, cleaner, more reliable solutions than hand crafted SQL.
Not if you've been hand crafting clean reliable SQL for twenty years. If Linq produces better SQL than you do, then go with it.
PIEBALDconsult wrote:
Not if you've been hand crafting clean reliable SQL for twenty years.
Not quite what I meant: I was thinking more that finger trouble with LINQ is more likely to cause a compilation error, where in SQL it is run time and so harder to test and detect.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
-
PIEBALDconsult wrote:
Not if you've been hand crafting clean reliable SQL for twenty years.
Not quite what I meant: I was thinking more that finger trouble with LINQ is more likely to cause a compilation error, where in SQL it is run time and so harder to test and detect.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
Oh, sure, but you can develop and test your more-complex SQL statements with another tool and then copy-and-paste them into your application. An additional benefit of that is that it drives parameter use rather than concatenation.
-
Oh, sure, but you can develop and test your more-complex SQL statements with another tool and then copy-and-paste them into your application. An additional benefit of that is that it drives parameter use rather than concatenation.
I would assume that Linq generates parametrized queries anyway: I always use them with SQL. :-D
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."