Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the author is simply inexperienced in C#. Here's the right way to express his code:

    string.Join("\n",
        from elem in myList
        where elem.Description != ""
        select elem.Description);
Note how mind-numbingly close this is to the Python:

   "\n".join(foo.description() for foo in mylist
                         if foo.description() != "")
I also think it's considerably easier to read than the foreach loop.


Note that this article is from 2006. Hence his using of C# 2.0 instead of a later version which includes Linq.


Linq, which was inspired by ... Haskell!

Would it be irresponsible to speculate that this article is directly responsible for the inclusion of Linq in C#? It would be irresponsible not to speculate!


LINQ was introduced by Erik Meijer, an Haskell researcher working on .NET team.

http://research.microsoft.com/en-us/um/people/emeijer/papers...


a true gem, thanks for this. where did you find out about this paper?


I read a lot research papers, specially related to compiler design.


I've read this article in 2006. Even in this year it was obviously provocative.

Now everybody knows that type inference, list comprehensions and lambda functions can reduce code. Even javers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: