Coffeehouse Thread

55 posts

Linq is scary

Back to Forum: Coffeehouse
  • Secret​Software

    Hi,
       I think LINQ is really scary. This LINQ project is really very powerful in the sense that it will revolutionize the way we write code for the future. I mean we will be writing less for loops and less loops in general to iterate through objects and arrays and that is really significant in terms of performance. To select based on criteria and have the results in your face in a matter of microseconds is really scary.

    I mean wow. Just instant gratification! How does the SQL team feal about LINQ? Is LINQ their Boggart?

    I think I will never write another T-SQL again.

    What do you guys think? Have you played with the CTPs?

    Cool

  • Harlequin

    You'll still have SQL and stored procs, that's in the business logic(BL) layer. But if you step outside in the UI layer, the UI might not need the entire List<T> brought back by the BL and if I remember right you can use Linq to chew down that list to something you'd need in the UI.

  • Secret​Software

    But I mean SQL as a language should  not be used alot. I mean with LINQ you can do alot more, by writing few words. That is real value. Because now your program will spend less time in loops and just more time idle waiting for the next instructions from the user. It really is breath taking and will revolutionize the way source code looks. Most of it will not have loops except in few places. Which is great!

    Now If only MS would release the Orcas CTPs as stand alone msi then alot more people who dont want to run virtual pc, would play with it.

    Because of the holidays more people have time to try the ctps now. I certainly did, and was amazed.

  • JohnAskew

    SecretSoftware wrote:
    But I mean SQL as a language should  not be used alot. I mean with LINQ you can do alot more, by writing few words. That is real value. Because now your program will spend less time in loops and just more time idle waiting for the next instructions from the user. It really is breath taking and will revolutionize the way source code looks. Most of it will not have loops except in few places. Which is great!



    I agree and I look at it as another step down the path taken with ADO.NET's disconnected DataSet paradigm.

    We go to the well, but not too often. Pruning shall be client-side.

    Hardware & especially memory is allowing this route, imho, and I am also very excited about what you point out, ss.

  • odujosh

    I have written my share of SQL Plumbing. I think I personally would be perfecticly happy to sac the perf by doing Stored procs in favor of granularity and speed of development. Its hard for example to write TSQL that only updates fields that have changed. With SQL Linq this will no longer be the case. I nearly jumped up and down when I heard of Linq.

  • harumscarum

    thumbtacks wrote:
    The loops are still there...but they are abstracted away. In reality, I'm surprised nobody has come up with this concept before. But like I said before, that's the difference between actually innovating something and just copying what others do. That's the difference Anders is making here.


    You soooo "get" the big picture.


  • Secret​Software

    thumbtacks wrote:
    The loops are still there...but they are abstracted away. 


    How?

    PS: I am not fully aware of the details of the implementations MS did in Linq, but I am happy with the results of such implementations because I see instant results and instant power in performance, which is what I really care about as a developer.

    Having experianced what LINQ is all about after hearing about it for some long period of time, I can say I never want to go back without LINQ, infact I wish I could use it in my everyday development work. As I said, I want the future now!.

  • JohnAskew

    SecretSoftware wrote:
    
    thumbtacks wrote: The loops are still there...but they are abstracted away. 


    How?

    PS: I am not fully aware of the details of the implementations MS did in Linq, but I am happy with the results of such implementations because I see instant results and instant power in performance, which is what I really care about as a developer.

    Having experianced what LINQ is all about after hearing about it for some long period of time, I can say I never want to go back without LINQ, infact I wish I could use it in my everyday development work. As I said, I want the future now!.


    Me neither. It could be loops that are buried within LINQ, or indexes, I don't know.

    The one thing I agree with Thumbtacks about (and it may be the first ;D) is that Anders is a freaking GENIUS. Why? Well Thumb had his chance at discovering and implementing LINQ, but didn't...

    [6]

  • Secret​Software

    thumbtacks wrote:
    
    SecretSoftware wrote: 
    thumbtacks wrote: The loops are still there...but they are abstracted away. 
    How?
    Well, although I have not ever sat down at looked at how a database operates on the backend (as far as how the actually data is sorted through in response to a SQL query) I would surmise that there is some type of looping going on. Some day I'll do that. I suppose I could look at some open source implementation of a database and pore over the code on my own. But I would guess that in order to move through a massive collection of data (thousands of entries let's say), you have to do some type of looping...although it is an intelligent, guided type of looping based on the SQL syntax. Although it's not hard to write sloppy SQL and watch a query stall out for several minutes and return thousands of records when it should only return a few.


    From the interviews that Andres did, there is some kind of enumeration that goes on, but its optimized to be efficient. It uses lambda expressions and expression trees to retrun results using many threads.

    Now they will multiply the speed and efficiency with the use of pLINQ which will take advantage our new multi-core world.

    http://www.microsoft.com/presspass/features/2005/sep05/09-13NETLanguage.mspx

  • odujosh

    Of course hopefully the DAL is not a matter for someone  who doesn't test thier queries before making a stone tablet for it. (stored proc)

  • Secret​Software

    JohnAskew wrote:
    
    SecretSoftware wrote: 
    thumbtacks wrote: The loops are still there...but they are abstracted away. 


    How?

    PS: I am not fully aware of the details of the implementations MS did in Linq, but I am happy with the results of such implementations because I see instant results and instant power in performance, which is what I really care about as a developer.

    Having experianced what LINQ is all about after hearing about it for some long period of time, I can say I never want to go back without LINQ, infact I wish I could use it in my everyday development work. As I said, I want the future now!.


    Me neither. It could be loops that are buried within LINQ, or indexes, I don't know.

    The one thing I agree with Thumbtacks about (and it may be the first ;D) is that Anders is a freaking GENIUS. Why? Well Thumb had his chance at discovering and implementing LINQ, but didn't...



    Having someone describe the power of LINQ to you , and actually experiancing it in development environment are two different things. I am actually not sure why there is not much fuss or buzz about LINQ. People should be excited about it and talking about it all over the programming places. Its a freakingly scary , jaw-dropping experiance. I mean this will literally change the way we implement ideas and designs of new software. I mean literally!!!! Cool

  • Secret​Software

    thumbtacks wrote:
    
    SecretSoftware wrote: Having someone describe the power of LINQ to you , and actually experiancing it in development environment are two different things. I am actually not sure why there is not much fuss or buzz about LINQ. People should be excited about it and talking about it all over the programming places. Its a freakingly scary , jaw-dropping experiance. I mean this will literally change the way we implement ideas and designs of new software. I mean literally!!!! 
    So you are saying I should quick learn about it, write up a book and cash in on the upcoming market?

    Hmmm.

    Nope, I've got other things to finish first.



    I am excited about it because I feel as if i just landed from a rollercoaster ride. Its a feeling of happiness to plan in your head how LINQ will reduce 5000 lines of code significantly. Did you ever feel like when someone removes a noise that you always hear, and then you say that makes me feel better , why did I not remove it along time ago? That Is how I feel. No Kidding. This stuff is gold. Its value to me is much more than Gold, because now I can do alot with few words, and cross many boundries at the same time. I feel like I have the power of God! Hence , Its scary.

  • JohnAskew

    thumbtacks wrote:
    
    SecretSoftware wrote: I am excited about it because I feel as if i just landed from a rollercoaster ride. Its a feeling of happiness to plan in your head how LINQ will reduce 5000 lines of code significantly. Did you ever feel like when someone removes a noise that you always hear, and then you say that makes me feel better , why did I not remove it along time ago? That Is how I feel. No Kidding. This stuff is gold. Its value to me is much more than Gold, because now I can do alot with few words, and cross many boundries at the same time. I feel like I have the power of God! Hence , Its scary.
    Abstraction != performance gains.

    Productivity gains, maybe. How does LINQ work on huge collections of data? Like giant XML documents or large databases. Does it play nice with Oracle databases when you are pulling data from a dozen tables in an effort to retrieve hundreds or thousands of records?


    I'd bet a small amount of cash that the way in which LINQ is implemented WILL result in measurable performance gains, perhaps humanly noticeable.

    Thumb, I will definitely take a look at your "whoa". That's what makes our jobs FUN. Happy Holidays.

    I am very very excited about LINQ, or did I say that already?
    Smiley

  • Secret​Software

    Do the guys in the Search departments in MS  find LINQ useful? Do they already take advantage of it?

    All I say is that those who have not jumped in the .NET bandwagon yet are missing out some cool stuff.

    Are the people inside MS using it in new applications?

    There are applications in which LINQ would simplify life in Acadamia. Like detecting plagiarism between assignments.  Or in medical fields to , query patient records or in bioinformatics industry. Cool new little tools and applications that do alot, but are smaller in size.

    One cannot help but feel overwhelmed with new ideas, simply because the power that linq puts under one's finger tips enables new visions , ideas, and possibilities.  Not that SQL did not have this before, but SQL had its own problems, and you had to learn it as a language in its own right. Now the new developers would just learn C# or VB.NET, and they are good to go. No need to know SQL.


    Come to think about it, why did MS not introduce LINQ years ago? Somehow MS now is going instep with developers worldwide. People now only have to learn one language and be able to tab into many different areas. The power of one unified language that fits and rules mostly all!.


    So, (*whooo, takes a deep breath.. sigh*), yea. I beleive Andres and the teams he collaborates with is the best thing that happened to MS Developer division in recent years. Because the clarity is just there, and the simplicity also. So he does have good taste and invents new techies that people need, not just want. More power to you Andres and the teams that  are bringing this gold to many developers around the globe!

  • JohnAskew

    SecretSoftware wrote:
    I beleive Andres and the teams he collaborates with is the best thing that happened to MS Developer division in recent years. Because the clarity is just there, and the simplicity also. So he does have good taste and invents new techies that people need, not just want. More power to you Andres and the teams that  are bringing this gold to many developers around the globe!



    Ditto, from an old Delphi dev. (who still can't stand VB/VB.NET whatsoever).

  • Secret​Software

    JohnAskew wrote:
    
    SecretSoftware wrote: I beleive Andres and the teams he collaborates with is the best thing that happened to MS Developer division in recent years. Because the clarity is just there, and the simplicity also. So he does have good taste and invents new techies that people need, not just want. More power to you Andres and the teams that  are bringing this gold to many developers around the globe!



    Ditto, from an old Delphi dev. (who still can't stand VB/VB.NET whatsoever).


    So long as you are using a language that supports .NET framework, then it does not matter what flavor of a language you want to write with. You could put C# flavor in your source code dish, or VB.NET or Delphi or managed C++. Maybe even some salt and pepper too would not hurt:P The machine would eat the source code dish anyways in the same way!

  • stevo_

    thumbtacks wrote:
    
    SecretSoftware wrote:I am excited about it because I feel as if i just landed from a rollercoaster ride. Its a feeling of happiness to plan in your head how LINQ will reduce 5000 lines of code significantly. Did you ever feel like when someone removes a noise that you always hear, and then you say that makes me feel better , why did I not remove it along time ago? That Is how I feel. No Kidding. This stuff is gold. Its value to me is much more than Gold, because now I can do alot with few words, and cross many boundries at the same time. I feel like I have the power of God! Hence , Its scary.
    Abstraction != performance gains.

    Productivity gains, maybe. How does LINQ work on huge collections of data? Like giant XML documents or large databases. Does it play nice with Oracle databases when you are pulling data from a dozen tables in an effort to retrieve hundreds or thousands of records?


    Dunno, abstraction can sometimes mean performance gains, for example- some core functionality in the .net platform is done in ways that you couldn't achieve in c#, also abstraction can also mean the abstracted code was written by someone better than yourself Wink.

    Abstraction has productivity and reliability gains mostly though.

    As for playing nice, LINQ query is stored in query trees, those trees are handed to a provider that converts the query tree into the SQL query translation, so you can write your own providers that you give a query tree and they interpret it based upon the rules you write.

  • staceyw

    Yes it is way good.  Someone else could have done the library, but we still needed MS for the language integration (i.e. sugar).  And, as I see it, it just the start.  Once can easily imagin the next step would be to remove more of the middle layers and "linq" more directly into the engine.  And if the engine goes farther into supporting native .net primitive types, we could see even more goodness imo.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.