Live data from Hacker News

More functional C#

news.ycombinator.com

61–70 of 98 posts

Re: More functional C#

#61
post #19

Earlier quoted context omitted.

C# is a language with a somewhat limited market ("Enterprise" applications running on Windows Servers, and yes, I know about Mono) One would think that Windows Phone - fastest growing smartphone OS - would go before Mono... geez, I make a living out of desktop C# apps (WPF). Not solely, but on a daily basis.

Fastest growing is easier to achieve when you have low market share. Mono is significantly more important for the future of C# than Windows Phone.

"Easier" doesn't mean easy - many players to the table, we are yet to see whether Tizen or Firefox OS manage to pull that easy feat.

What makes you think Mono plays (or is about to play) such a pivotal role?

Re: More functional C#

#62
post #53

Earlier quoted context omitted.

Well, I use it =) C# is a language with a somewhat limited market ("Enterprise" applications running on Windows Servers, and yes, I know about Mono). And in this market, a very strict subset of C# (see: Java) is happily used. I know a lot of people who refrain from using even lambdas and implicit typing, let alone the other "fringe functional stuff", because "they make things complicated".

I've actually worked at 2 startups using C# and been contacted by 2 others in the last year trying to poach talent. C# is popular in many contexts.

The same goes for me! My first job was at a startup that used ASP.NET with C# (with PHP for micro-sites). From there, I've worked at agencies where I've built both large sites and small sites using ASP.NET and C#.

The whole notion of .NET only being suitable for enterprise development is bullshit.

Re: More functional C#

#63
post #11

I have read a lot of lang. wars and complaints about programming languages... but C# is one of the only languages that I can't remember reading any complaints about. None. I must conclude, by the usual Stroustrup quote, that no one uses C#. (yes this is tongue in cheek)

It's sad how C# is put on a pedestal, since it has plenty of obvious critical flaws, see links below for a list and this is just the tip of the iceberg. http://hestia.typepad.com/flatlander/2012/01/action-func-voi... http://trelford.com/blog/post/LighterCSharp.aspx http://stackoverflow.com/questions/411906/c-sharp-net-design... http://joeduffyblog.com/2010/06/27/on-partiallyconstructed-o... http://blogs.msdn.com/b/ds…

http://hestia.typepad.com/flatlander/2012/01/action-func-voi...

I fail to see how it is an "obvious critical flaw" :)

   You have to create a separate overload that takes an Action instead of a Func, 
   and has an identical implementation except for omitting the return keyword.  
   Granted, that’s not much work for a simple helper like the above, 
   but what if it were more complicated?  
No, it's simply not true that you need "an identical implementation except for omitting the return keyword"...

Eg. this would do the trick without repeating the implementation: http://pastie.org/8628864

Just two one-line overloads as entry points.

Re: More functional C#

#64
post #58

Earlier quoted context omitted.

Well, I use it =) C# is a language with a somewhat limited market ("Enterprise" applications running on Windows Servers, and yes, I know about Mono). And in this market, a very strict subset of C# (see: Java) is happily used. I know a lot of people who refrain from using even lambdas and implicit typing, let alone the other "fringe functional stuff", because "they make things complicated".

That really cracks me up! I work in C# probably 80% of the year (python and shudder vbscript make up the remainder) and I use lambda statements, implicit typing, and anonymous functions almost every day. The Linq IEnumerable extensions are also pretty well indispensable for me. My biggest complaint with C# is the limitations imposed by the static typing system: anonymous functions can't be generic, so you're forced t…

For me, LINQ was definitely a "gateway feature" to the lisp world. If you still use C# at work, I strongly suggest checking out F#: https://news.ycombinator.com/item?id=7048522

Re: More functional C#

#65
post #62
post #53

Earlier quoted context omitted.

I've actually worked at 2 startups using C# and been contacted by 2 others in the last year trying to poach talent. C# is popular in many contexts.

The same goes for me! My first job was at a startup that used ASP.NET with C# (with PHP for micro-sites). From there, I've worked at agencies where I've built both large sites and small sites using ASP.NET and C#. The whole notion of .NET only being suitable for enterprise development is bullshit.

It's not that it is only ever used for enterprise, just that it seems to be mostly used for enterprise. Think of the licensing costs for visual studio, sqlserver and windows server. Sure there is the Bizspark, but it runs out, and I think most founders would be squeamish with the potential business-technical debt that would represent.

At least right now, MS is still seen (although less lately) like the Big Bad, so giving them money to use what you can get for free or near-free elsewhere seems uncool and like bad business sense.

I suspect too from my own extremely limited sample size that .NET developers make more money on average than the average of the other languages, so that is also a liability when looking for talent when you have limited cash.

Re: More functional C#

#66
post #24

Earlier quoted context omitted.

Because "near functional" is sufficient most of the time and if there is no compelling reason to split your codebase among two different languages, you shouldn't do it. Not to mention that there's probably 1000 C# developers for every F# developer Have a look at http://www.indeed.com/jobanalytics/jobtrends?q=c%23%2C+f%23&... And someone has to maintain your near functional or functional code

The easy solution -- take a few of your best C# developers and give them two weeks to learn F# and build a small project with it. You don't have to hire developers from outside to bring new technologies into a company. In fact, given the scarcity (i.e., demand > supply) of good developers these days, it's almost certainly going to be easier and faster to have your existing development staff learn those new technologi…

This is one of the reasons I think F# is such a powerful tool. It is so simple, consistent, and safe I found it very easy to learn quickly.

I think I actually spent more time learning Entity Framework than I did learning F#, and EF still catches me with weird edge cases. Meanwhile F#'s crazy smart compiler is catching all mine ;)

Re: More functional C#

#67
post #50
post #21

Earlier quoted context omitted.

It's a little bit too verbose, it doesn't have quite the flexibility or metaprogramming ability of a language like Python. But in general it's a very solid choice. You can even get around a lot of the inefficiency of GC by careful usage of structs.

With the rise of Roslyn[0], your second argument is kinda void (metaprogramming) I never got the verbosity argument. Verbosity comes down to the person using the language. With C#, you can be as verbose as you want to. Do you have any examples? What kind of inefficiency are you speaking of? the CLR's GC is one of, if not the, most efficient around. [0] http://msdn.microsoft.com/en-gb/roslyn

Speaking as a C# developer:

I do consider C# more verbose than the languages I love to look at. Think 'SelectMany', 'FirstOrDefault' and similar constructs - even if you write functional C# as much as possible, it still .. is verbose. If compared to F#, Clojure for example.

I don't think that's an issue, mostly, but that I do agree with the notion that C# is 'verbose'.

Re: More functional C#

#68
post #62

Earlier quoted context omitted.

The same goes for me! My first job was at a startup that used ASP.NET with C# (with PHP for micro-sites). From there, I've worked at agencies where I've built both large sites and small sites using ASP.NET and C#. The whole notion of .NET only being suitable for enterprise development is bullshit.

It's not that it is only ever used for enterprise, just that it seems to be mostly used for enterprise. Think of the licensing costs for visual studio, sqlserver and windows server. Sure there is the Bizspark, but it runs out, and I think most founders would be squeamish with the potential business-technical debt that would represent. At least right now, MS is still seen (although less lately) like the Big Bad, so gi…

I worked professionally on VS Express for quite a while. Yes it's less convenient, but it can be done. Still a better IDE than (say) NetBeans. I know it's apples and oranges, but I'm speaking about an overall impression.

Re: More functional C#

#69

What's the point of writing code in a functional way to end up with something that is completely unreadable? I'd rather have code written in simple, well factored functions and classes and easy to reason about, than having to deal with such a mess of functional code. Don't get me wrong, functional code can be very elegant and clear, but the example provided here is a huge turn off to me.

I don't like the underscore notation (I think it's foreign to C#), but other than that it's very readable to me, so I guess it's a matter of practice and (acquired) taste

Re: More functional C#

#70
post #68

Earlier quoted context omitted.

It's not that it is only ever used for enterprise, just that it seems to be mostly used for enterprise. Think of the licensing costs for visual studio, sqlserver and windows server. Sure there is the Bizspark, but it runs out, and I think most founders would be squeamish with the potential business-technical debt that would represent. At least right now, MS is still seen (although less lately) like the Big Bad, so gi…

I worked professionally on VS Express for quite a while. Yes it's less convenient, but it can be done. Still a better IDE than (say) NetBeans. I know it's apples and oranges, but I'm speaking about an overall impression.

You should check out Intellij. http://www.jetbrains.com/idea/

I think its free version is still better than most paid VS editions. The $500 edition is the best IDE I've seen. And it supports basically every language but the three .NET languages.

Post reply on HN