Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: LINQ/Ambition for Perl?

by MikeKulls2 (Novice)
on May 01, 2013 at 00:17 UTC ( #1031486=note: print w/ replies, xml ) Need Help??

in reply to Re^2: LINQ/Ambition for Perl?
in thread LINQ/Ambition for Perl?

I know this is an old thread but I can't help but adding my 2c. IMO, linq is awesome but only for linq to objects or linq to xml. As a replacement for SQL it's not really that useful imo. It just adds an extra unnecessary layer that makes it more difficult to debug and optimise. It's also more difficult to write and makes it very difficult or impossible to use some of the newer features of a database. It usually reduces performance as it can add extra complexity to the underlying sql. If your motivation is to avoid learning sql then just learn sql.

The only place it could be useful is if you want your app to target a number of databases. However it's probably better just to write simple SQL that will work with many DBs.

Comment on Re^3: LINQ/Ambition for Perl?
Replies are listed 'Best First'.
Re^4: LINQ/Ambition for Perl?
by Jenda (Abbot) on May 01, 2013 at 14:26 UTC

    Well, in strong typed languages LINQ gives you compile time type checking both within the query and of the result. That's definitely a nice to have, especially in combination with intellisense. In some sense it's a nice way to prototype queries especially since (and now I'm taking about C#/VB.Net) with anonymous types, you can easily and on just one place add some more columns to the result set and have them available right away. No code generation, no changes in different layers, ...

    If you then find out that the query got too complex, is not performing well enough or just want to keep all queries in the database, you can change the LINQ query to a stored procedure call.

    If the "extra layer" makes it difficult to debug and optimize, then the query has already got too complex and needs to be moved to a stored procedure or hidden in a database view that you can then use in LINQ to go the last step.

    Enoch was right!
    Enjoy the last years of Rome.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031486]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2015-10-10 11:00 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (255 votes), past polls