Missing LINQ?
-
Scott Dorman wrote:
to reduce the complexity of accessing and integrating information that is not natively defined using OO technology
Yeah, that's always been one of the biggest problems. Xml serialization has bridged the XML gap somewhat, but database has always been a problem. And I'm not sure I like most current and past approaches to addressing that. I wasn't a huge EJB fan, but then again, I didn't do a lot of work with them. I suppose LINQ may be a step forward, but the syntax just looks so bizzare to me.
Try code model generation tools at BoneSoft.com.
BoneSoft wrote:
I suppose LINQ may be a step forward, but the syntax just looks so bizzare to me.
It's definately a step forward. I think we'll see a lot more improvements in the next release of the Framework (after 3.5). The syntax does take some getting used to, but I think once you do it will feel more natural than trying to write embedded SQL or dealing with SqlCommand objects.
Scott.
—In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]
-
BoneSoft wrote:
the examples I've seen seem to be complete giberish
Right now there isn't anyone at Microsoft focused specifically on LINQ and getting the word out about it. A lot of the examples try to show the "power" of LINQ, but don't do a good job at it because they are either hard to read/understand, incomplete, or don't show it in the context of a real-world scenario.
Scott.
—In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]
I guess that makes sense. I suppose I should be content to do my thing for the time being and learn it when it's more main-stream. But lately I've been feeling like I'm falling behind. WPF is completely foreign to me still, as are most of the C# enhancements scheduled for 2008. Most of the enhancements in C# 2.0 made sense and were welcome changes. Most of what I've seen for 3.5 don't have the same appeal to me. It's like getting your new 2005 boss that does some great things for the department, then after a year brings in your new supervisor 2008 who likes to call you at 3 in the morning to make sure you're answering on-call pages. Just seems like something's wrong under the surface. Maybe I'm just getting old and set in may ways, which is something to guard against in this business. In any event, I guess it's comming. I'll have to deal with it when it releases anyway.
Try code model generation tools at BoneSoft.com.
-
BoneSoft wrote:
the examples I've seen seem to be complete giberish
Right now there isn't anyone at Microsoft focused specifically on LINQ and getting the word out about it. A lot of the examples try to show the "power" of LINQ, but don't do a good job at it because they are either hard to read/understand, incomplete, or don't show it in the context of a real-world scenario.
Scott.
—In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]
Scott Dorman wrote:
Right now there isn't anyone at Microsoft focused specifically on LINQ and getting the word out about it.
I don't know... Daniel Moth, one of the UK's DPEs, has done quite a good job in some of his presentations. http://www.danielmoth.com/Blog/2007/02/decomposing-linq.html[^] Skip to the last code sample to see what it looks like without LINQ. Daniel has got quite a good series of blog posts on LINQ. I've also got some information on LINQ and some of the new language constructs in C# 3.0: * Anonymous Types[^] * Method Extensions[^] * Automatic Properties[^] * A start on LINQ[^] * Object Initialisers I[^] * Object Initialisers II[^] * Object Initialisers III[^]
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
-
I guess that makes sense. I suppose I should be content to do my thing for the time being and learn it when it's more main-stream. But lately I've been feeling like I'm falling behind. WPF is completely foreign to me still, as are most of the C# enhancements scheduled for 2008. Most of the enhancements in C# 2.0 made sense and were welcome changes. Most of what I've seen for 3.5 don't have the same appeal to me. It's like getting your new 2005 boss that does some great things for the department, then after a year brings in your new supervisor 2008 who likes to call you at 3 in the morning to make sure you're answering on-call pages. Just seems like something's wrong under the surface. Maybe I'm just getting old and set in may ways, which is something to guard against in this business. In any event, I guess it's comming. I'll have to deal with it when it releases anyway.
Try code model generation tools at BoneSoft.com.
BoneSoft wrote:
lately I've been feeling like I'm falling behind
I know that feeling. The Framework (and other associated technologies) are changing too fast for almost anyone to keep up.
BoneSoft wrote:
WPF is completely foreign to me still, as are most of the C# enhancements scheduled for 2008.
WPF will eventually be a great thing, but it is still too raw to be really useful. Fortunately, most of the C# enhancements for 2008 are simple once you are able to break them down and look at them outside of the "bigger" technology they are in place to support. A good example are extension methods. Check out this blog post[^] to get an idea of how they work.
BoneSoft wrote:
Most of the enhancements in C# 2.0 made sense and were welcome changes. Most of what I've seen for 3.5 don't have the same appeal to me.
I agree with you on that. The biggest problem is that most of the new stuff in 3.5 is couched in the context of the "bigger" items. Once you start to break them apart and look at the underlying pieces separately, things start to make more sense and have a greater appeal.
BoneSoft wrote:
Maybe I'm just getting old and set in may ways, which is something to guard against in this business.
I'll reserve comment on that one. :-D
BoneSoft wrote:
In any event, I guess it's comming. I'll have to deal with it when it releases anyway.
Well...only if you want to make use of the new features. Just because it's been released in the language doesn't mean you have to use it.
Scott.
—In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]
-
Scott Dorman wrote:
Right now there isn't anyone at Microsoft focused specifically on LINQ and getting the word out about it.
I don't know... Daniel Moth, one of the UK's DPEs, has done quite a good job in some of his presentations. http://www.danielmoth.com/Blog/2007/02/decomposing-linq.html[^] Skip to the last code sample to see what it looks like without LINQ. Daniel has got quite a good series of blog posts on LINQ. I've also got some information on LINQ and some of the new language constructs in C# 3.0: * Anonymous Types[^] * Method Extensions[^] * Automatic Properties[^] * A start on LINQ[^] * Object Initialisers I[^] * Object Initialisers II[^] * Object Initialisers III[^]
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
Colin Angus Mackay wrote:
I don't know... Daniel Moth, one of the UK's DPEs, has done quite a good job in some of his presentations.
Absolutely. Daniel has done an excellent job, but as far as I know he's not focused on the .NET Framework as a whole, but rather specific pieces. (I'm not actually sure what Daniels focus is since he does tend to have a rather ecclectic set of topics. :)) That's more what I was referring to. There currently isn't anyone in DPE that is focused specifically on tying together the pieces and covering the Framework and Visual Studio changes from a "big picture" viewpoint.
Scott.
—In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
LINQ is more syntactic sugar, but it can be powerful. My only fear is how badly it will perform in the hands of the ignorant. But that's a good thing, having features that are powerful in the right hands, instead of worrying about what they can do in the wrong hands, is a step towards the C++ approach to language design. I applaud that. Now they just need to make switch statements more useful, and provide a meaningful const keyword.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
LINQ is more syntactic sugar, but it can be powerful. My only fear is how badly it will perform in the hands of the ignorant. But that's a good thing, having features that are powerful in the right hands, instead of worrying about what they can do in the wrong hands, is a step towards the C++ approach to language design. I applaud that. Now they just need to make switch statements more useful, and provide a meaningful const keyword.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Scott Dorman wrote:
to reduce the complexity of accessing and integrating information that is not natively defined using OO technology
Yeah, that's always been one of the biggest problems. Xml serialization has bridged the XML gap somewhat, but database has always been a problem. And I'm not sure I like most current and past approaches to addressing that. I wasn't a huge EJB fan, but then again, I didn't do a lot of work with them. I suppose LINQ may be a step forward, but the syntax just looks so bizzare to me.
Try code model generation tools at BoneSoft.com.
It's really no worse than learning the regular expression syntax is it?
Todd Smith
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
I'm with you 100%. It looks cryptic, bizarre and no one here has yet been able to give me any compelling reasons why I should care about it or use it for anything in my day to day work. If it's somehow related to querying then why in the world the weird syntax? Many of us programmers are intimately familiar with sql syntax, something that was close would have made for easier adoption. I'll wait until 2010 as others have said or until it's damn near impossible not to use it then have a look at it. If I really cared I could learn it quickly I'm sure but without a good reason behind it I fail to see the point of wasting brain space on something so mundane and clearly obtuse.
Modo vincis, modo vinceris.
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
I have to deal with collections a lot in my code. LINQ to Objects has been especially useful in this regard. LINQ offers several common functions that work for custom collections and standard collections alike. (Granted you can always write the functions but with LINQ you don't have to anymore). Sorting, Filtering and grouping data for all collections is now far more easier. Again it si for my specific case as I use collections a lot. Another beautiful thing is that LINQ unifies querying over SQL and that over objects. Your code need not bother whether it is querying over objects or databases (or even XML). For database (SQL Server mainly) the code is automatically transformed to SQL and is run on the database server and for objects it automatically uses the built-in LINQ to objects. The LINQ to XML stuff is far simpler than XML DOM or even using XML Reader directly.
Co-Author ASP.NET AJAX in Action
-
It's really no worse than learning the regular expression syntax is it?
Todd Smith
I dunno, Regex wasn't that foreign and I could immediately see the point and the benefit. But purely with respect to learning curve, the jury's still out until I actually learn LINQ. (If I actually learn LINQ)
Try code model generation tools at BoneSoft.com.
-
I'm with you 100%. It looks cryptic, bizarre and no one here has yet been able to give me any compelling reasons why I should care about it or use it for anything in my day to day work. If it's somehow related to querying then why in the world the weird syntax? Many of us programmers are intimately familiar with sql syntax, something that was close would have made for easier adoption. I'll wait until 2010 as others have said or until it's damn near impossible not to use it then have a look at it. If I really cared I could learn it quickly I'm sure but without a good reason behind it I fail to see the point of wasting brain space on something so mundane and clearly obtuse.
Modo vincis, modo vinceris.
It's good to know I'm not alone. I rarely get to talk shop and don't really know where the majority stands on this stuff. With LINQ specifically, it looks like it will always be an optional tool. But with all the new stuff, I feel like I need to learn enough to decide if it's worth my while to delve into full throttle.
Try code model generation tools at BoneSoft.com.
-
I have to deal with collections a lot in my code. LINQ to Objects has been especially useful in this regard. LINQ offers several common functions that work for custom collections and standard collections alike. (Granted you can always write the functions but with LINQ you don't have to anymore). Sorting, Filtering and grouping data for all collections is now far more easier. Again it si for my specific case as I use collections a lot. Another beautiful thing is that LINQ unifies querying over SQL and that over objects. Your code need not bother whether it is querying over objects or databases (or even XML). For database (SQL Server mainly) the code is automatically transformed to SQL and is run on the database server and for objects it automatically uses the built-in LINQ to objects. The LINQ to XML stuff is far simpler than XML DOM or even using XML Reader directly.
Co-Author ASP.NET AJAX in Action
That brings up another problem with data access that's been around as long as data access has... The framework has gone a long way toward making it easier to access different engines, but it only abstracts to a certain degree. Data access may never have a single interface between different platforms. But that comes down more to standards than anything. But for XML, I refuse to worry about the DOM or XmlReader. I love XML seriliazation. And I can't imagine LINQ or anything else improving on that. All you need is a nice tool (like mine ;P) and you instantly have an XML serializable model that can be used for that and any other purpose. It's one of the many reasons I may never look back at Java again, I hated dealing with their DOM or SAX or basically any of their XML models.
Try code model generation tools at BoneSoft.com.
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
I like it. So there. :->
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- Chris Losinger, Online Poker Players?
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
The reason Linq looks wierd is that, to get intellisense to work, they had to but the "subject" of the query in front. So, with DLinq, it's the table name. Otherwise intellisense wouldn't be able to help the lazybones programmer figure out the columns associated with the table. Marc
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
BoneSoft wrote:
But could it not have been more... SQL-like?
Ummm - it pretty much *is* SQL, apart from the ordering of the statement clauses? This example off Wikipedia looks quite SQL-ish to me.
var q = from o in db.Orders, c in db.Customers
where o.Quality == "200" && (o.CustomerID == c.CustomerID)
select new { o.DueDate, c.CompanyName, c.ItemID, c.ItemName };The other thing to remember is that LINQ is generalized across *anything*, so long as it implements the appropriate interface or methods. This makes it incredibly easy to perform operations on collections of objects, rather than having to loop over them. This feature is just one part of the migration into C# of features normally found in functional programming languages - type inference, lambdas, LINQ (pretty much equivalent to list comprehensions). Now, if they could work out how to safely add lightweight processes and message passing a la Erlang, .NET languages would really be in a good position to make good use of multicore chips. Of course, so long as you have shared, mutable state, you're always going to be in a position to have 'interesting' threading bugs.
-
BoneSoft wrote:
I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..."
I would very much doubt that. LINQ is just syntactic sugar for a number of new classes that were added to the .NET Framework. You can perform the same thing but without using LINQ by just calling the appropriate methods. In fact that should be taught because it will show people how it is actually put together.
BoneSoft wrote:
But could it not have been more... SQL-like?
No. The basis of C# and SQL are different. SQL is mostly a declarative set based language, while C# is procedural. (i.e. In SQL you say what you want and the query optimiser figures out how to get it. In C# you specify HOW you want it to function.) You can view LINQ as a hybrid of the two.
BoneSoft wrote:
Am I alone here or does anybody else have reservations about LINQ?
My only reservation about LINQ is that I can see how newbies will be able to abuse it without fully understanding what is going on under the hood.
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
I think that MS did an awesome job on the .net languages and the framework. I am yet to see another language compare to C# and a framework compare to .NET I have used the open source cousin (mono) and wasnt to impressed, and I have used Java and still not impressed. Where MS do kinda drop the balls is with the IDE and that is where most of you get confused, you tightly associate the IDE with the framework at that time. Yes they have been released at the same time (except for v3.0 of the framework). Managed programming has for years now made it very easy for newbies to create disgusting code (Java is included here) so I really think it is an education thing. Programmers need to still under go the same trainning (whether that is personal or formal) that one use to back in the day before managed code. So they can learn about the repocutions of bad code. Have them understand memory and processing and io, and sorting algorithms etc. So that they dont just associate the idea of writing a file with system.io etc. but actually understand what the underlaying is doing. On linq I have been playing with this for a long time now. I think it is awesome, it is as said really just a mask of what is going on in the background. However from a coding efficiency it is great. Not sure how many of you have played with Rail systems like Ruby, or MVC frameworks like codeigniter etc. If you have you will appreciate Linq being here. All I have a gripe with is the IDE and would like to see something more solid in the future, I have been working with BETA 2 of Orcas for a while now as well and there still some bugs but I am hoping that gets sorted by the end of the year. ;)
Mitchell Geere
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
I attended the MIX:07 conference and all the Microsoft bods were hyping up LINQ as the next big thing, when they were not hyping up silverlight that is :-) From my initial play around I'd say its useful for dynamic apps where users shape their queries, and significantly reduces the amount of code required to get an ASP dataset - otherwise its performance sucks. So its good if you want to make code readable, but are not to worried about the time it takes to get your data.
-
Is anybody else more than just a little uneasy about LINQ? The few examples I've seen make no sense to me. And I can't see what drove them to this solution either. I picture somebody at MS saying "ya know, let's take this well known standardized perfectly good query language that everybody is used to, chuck it out the window, and make a cryptic bizzare syntax built into the language itsef..." Ok, I can see some advantages to having it built it to the languages, not least of all avoiding the need for string storage and manipulation. But could it not have been more... SQL-like? Am I alone here or does anybody else have reservations about LINQ? And I know there are some people out there that are really excited about it, I'd like to hear what they have to say too.
Try code model generation tools at BoneSoft.com.
It took me about 15 minutes to get started with linq. The biggest difference is that you have to type the from-part first so intellisense knows what hints to give you. The rest looks a bit too much like SQL for me because linq is very different from SQL. Tried querying XML-files yet? or arrays/collections?