Actually, LINQ is just language-integrated queries and has nothing to
do with databases.  I've used it with collections (using System.Linq;)
resulting in code like:

var firstNamesOfThoseWithSurnames = from person in people where
person.Surname != string.Empty select person.FirstName;

And even with my own backend provider to provide something like
QuickCheck/ScalaCheck:

var randomPeople =
from firstName in randomNonEmptyStrings
  from surname in randomNonEmptyStrings
    select new Person(firstName, surname)

randomPeople.forAll(500, person => person.FirstName != string.Empty &&
person.Surname != string.Empty); //checks for 500 randomly generated
people that they all have a first name and surname.  I really should
have thought of a better example!

Sadly this didn't go too far because I wasn't really using C# for
anything, but it was fun.  I hope it illustrates that the similarity
between LINQ and SQL, while obviously not being a coincidence, doesn't
make LINQ 'for databases' exclusively.

Incidentally, Haskell's do, Scala's for and Common Lisp's LOOP macro
show that LINQ wasn't that novel an idea, but it probably is the first
time a mainstream language has had it, so well done to Eric et al.  I
wish I had more cause to use C#.

LOOP looks like: (loop for x in xs collect (* x 2)), where LINQ looks
like: from x in xs select x*2.
On Mon, Nov 15, 2010 at 10:44 AM, Casper Bang <[email protected]> wrote:
>> So why the constant talk about jumping to another platform where you have
>> the platform/language but have to start w/ soo much less, just because Java
>> does not have some feature thats in some other language on a non java
>> platform ? You seem to acknowledge the eco system but yet you are so quick
>> to devalue and abandon it just because of some life/death language feature ?
>
> Not at all, I'm saying I can get by without having to choose between 7
> different logging frameworks and 17 different web-frameworks. Less
> might be more for language features, but it most certainly is as well
> for frameworks.
>
>> Are you sure LINQ is *always* such a great idea ? LINQ4SQL has already been
>> end of lifed...It seems to me some people just like shiny things over there
>> because they dont have them.
>
> LINQ-2-SQL is just a provider, it has simply been super-seeded by the
> more advanced LINQ-2-Entities provider. Those who wish to remain with
> the less powerful but simpler approach, may use open-source providers
> like i.e. DbLinq up against their Oracle, MySQL, PostGres, Ingres or
> SQLServer instance.
>
> There might be an element of "the grass is greener" but would you
> argue against that arbitrary language level projection of data is a
> massively useful feature? A lot of people make the mistake of
> classifying LINQ as an ORM, when the truth is it's actually more like
> a baked in JDBC provider framework allowing you to map and reduce data
> from just about anywhere. Particular in these declarative and
> functional times, abstraction of this kind is needed if we wish to
> continue scaling.
>
>> Development work is all about headaches and nuisances like that, its never
>> been a perfect art. Im sure everybody's apis are never perfect, come back a
>> while later and you too will be stumped why you did that when it might not
>> make perfect sense.
>
> Naturally. But unless you are into S&M, you try to avoid too many
> bruises and headaches on your way. It's currently a very difficult art
> to choose framework that will remain relevant just a year from now,
> regardless of whether you go standard of de-facto. As a manager that
> would frighten me tremendously, because the end result might be quite
> a bit more severe than just a headache.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/javaposse?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to