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

Comparing C# 2.0's functional capabilities to Haskell/Python is terribly misleading. You can perform functional tasks easily in 3.5 using lambda expressions and built in functional operators such as:

listOfTestObjects.ForEach(x => sOutputDescriptions += "\n" + x.Description());

http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-...



I hate to nitpick, but this isn't comparable to the author's code. You're including empty descriptions and your output string will begin with a newline. These seem like small details, but they make a big difference in the conciseness with which you can write the statement.


This is very true. I was not attempting to port the author's code to .NET 3.5 as much as to introduce C# lambda expression syntax to the readers here.


Yeah, I figured. I just didn't want others coming away with the impression that C# is more concise than Haskell or Python. I mean, I love lambdas as much as the next C# programmer, but there is still a fair bit of clunky syntax to deal with when using C#'s great new features.




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

Search: