Amazing LINQ for .Net

  • Thread starter William Stacey [MVP]
  • Start date
W

William Stacey [MVP]

I must admit I don't know anything about FoxPro except what it is. However,
I think this far broader then that. Select over any (almost) collection,
DB, or XML in the *same manner and object model. Use anonymous types, have
strong typing and intellisense in the ~"sql" statement, etc. All any
application (NTFS, Registry, Exchange, AD, yours) needs to do is implement a
Linq object provider and you can operate over it like a T collection. If
this is a FoxPro feature, I am glad c# and VB have it now.

--
William Stacey [MVP]

Nicholas Paldino said:
Can anyone say FoxPro for C#?

=)

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

William Stacey said:
This is about the coolest thing since c#. MS just released the bits.
Have not seen any ink on it here, so just spreading the word.
http://objectsharp.com/blogs/barry/archive/2005/09/13/3395.aspx
 
N

Nicholas Paldino [.NET/C# MVP]

When I made the statement, the comparison was to FoxPro in the sense
that the statements for performing queries on data were part of the FoxPro
language.

I saw this a while ago, so I'm familiar with what it can do =)

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


William Stacey said:
I must admit I don't know anything about FoxPro except what it is.
However, I think this far broader then that. Select over any (almost)
collection, DB, or XML in the *same manner and object model. Use anonymous
types, have strong typing and intellisense in the ~"sql" statement, etc.
All any application (NTFS, Registry, Exchange, AD, yours) needs to do is
implement a Linq object provider and you can operate over it like a T
collection. If this is a FoxPro feature, I am glad c# and VB have it now.

--
William Stacey [MVP]

Nicholas Paldino said:
Can anyone say FoxPro for C#?

=)

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

William Stacey said:
This is about the coolest thing since c#. MS just released the bits.
Have not seen any ink on it here, so just spreading the word.
http://objectsharp.com/blogs/barry/archive/2005/09/13/3395.aspx
 
W

William Stacey [MVP]

When I made the statement, the comparison was to FoxPro in the sense
that the statements for performing queries on data were part of the FoxPro
language.

Fair enouph. IIRC, this will be available to any .Net language. And to
qualify, I don't get excited much anymore about most new stuff coming out,
but this has got me very interested. I mean if you use collections or
DBMSs, you got to be interested if this works as good as it looks.
I saw this a while ago, so I'm familiar with what it can do =)

Have you played with the bits yet? If so, what do you think?
 
A

Alfredo Novoa

When I made the statement, the comparison was to FoxPro in the sense
that the statements for performing queries on data were part of the FoxPro
language.

This is a very good thing. The problem is that the new language
extensions are based in an horribly designed language of the 70's
called SQL.

Here is an interesting essay from a retired member of the SQL
committee


Regards
Alfredo
 
J

Jon Skeet [C# MVP]

William Stacey said:
This is about the coolest thing since c#. MS just released the bits. Have
not seen any ink on it here, so just spreading the word.
http://objectsharp.com/blogs/barry/archive/2005/09/13/3395.aspx

I'm not at all sure I agree - at least not yet. To me, these look like
things which would be better done in a library than as part of the
language itself. Personally, I'd rather have design-by-contract (like
Spec#) than LINQ.

I'll need to look at it more closely before properly passing judgement,
of course...
 
N

Nicholas Paldino [.NET/C# MVP]

William,

I haven't played with the bits yet, but from what I have seen (demos and
whatnot, along with conversations with people at MS), I'm incredibly
impressed. I think there are some things that need to be addressed, but I
think this represents a huge leap in terms of programming.

If you look at the things that they are doing to make LINQ work, there
are some pretty interesting things (extension methods, lambda expressions,
anonymous types) which will (in my mind) lead to other interesting
combinations (besides LINQ).
 
W

William Stacey [MVP]

It is not sql, it sql like. And it is strongly typed. BTW - I would like
to see the essay, but you did not provide the link. TIA
 
W

William Stacey [MVP]

I'm not at all sure I agree - at least not yet. To me, these look like
things which would be better done in a library than as part of the
language itself. Personally, I'd rather have design-by-contract (like
Spec#) than LINQ.

I think you can do both. But I need to play with it some more as well to be
sure. Installed and ran some samples. Just digging in.
Method injection (sorta like Delphi class helpers) seems interesting.
Others have commented that some of this is "Ruby like" - not sure.
 
D

Daniel Jin

William said:
What are your concerns?

I can't say I have anything valid. I've only briefly looked over the
3.0 spec.

but first impress I have is something like var s = "literal" can be
quite often abused as the de facto way of declaring all local
variables.

more importantly, I don't know how far MS should take this compiler
code generation idea before it just becomes too much and bogs down the
language.
 
W

William Stacey [MVP]

but first impress I have is something like var s = "literal" can be
quite often abused as the de facto way of declaring all local
variables.

I see your point. On the other hand we have been able to do:
object s = "literal"

So not sure if it worse or not.
more importantly, I don't know how far MS should take this compiler
code generation idea before it just becomes too much and bogs down the
language.

Agree.
 
B

Bruce Wood

but first impress I have is something like var s = "literal" can be
quite often abused as the de facto way of declaring all local
variables.

I think that you misunderstand what "var" is in C#. It's not (and
Anders said so today) VB's "non-type", "this-can-be-anything"
declaration. All it does is instruct the compiler to _infer_ the type
from the initialization expression.

So, for example:

var abc = 5;

would result in "abc" being an int. If you later said:

abc = "Hello world.";

you would get a compiler error. This is _not_ turning C# into a
loosely-typed language. Far from it.

Similarly, Anders didn't give this example, but I imagine that:

var x;

would be illegal and result in a compiler error. Without an
initialization, there is no way for the compiler to infer a type for x.

Yes, I imagine that "var" _will_ become the usual way to declare local
variables, not because it removes type checking, but just because you
get the same thing with less typing.
 
B

Bruce Wood

No... I disagree. After seeing Anders' presentation today, I would tend
to say that this extension to C# is _not_ SQL. It uses some SQL
keywords, probably because everyone is familiar with them and it's
better to reuse terminology rather than invent new terms and confuse
everyone.

However, the new syntax is _much_ more logical and orthogonal than SQL,
and maps directly onto simple method calls.

It's impressively slick, really.
 
A

Alfredo Novoa

However, the new syntax is _much_ more logical and orthogonal than SQL,
and maps directly onto simple method calls.

I think this is exactly the contrary. The more I read about it the
more I am dissapointed :-(


Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top