Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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.

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2018-06-25 20:23 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (128 votes). Check out past polls.