Live data from Hacker News

More functional C#

news.ycombinator.com

51–60 of 98 posts

Re: More functional C#

#51
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/dsyme/archive/2013/03/25/quote-of-th...

Re: More functional C#

#52
post #7

But why do things "near functional" when you have F# which is fully functional?

This argument of purity of ideology reminds me more than a bit of the Salon system of French art. Unless your style was absolutely to their liking, your work was deemed refusé. Sometimes doing things in an imperative style, even with state and all the baggage that comes with it, results in easier to read and debug code.

I post a few threads down why I prefer F#, and none of my reasons are for "purity", you should check it out: https://news.ycombinator.com/item?id=7048522

Re: More functional C#

#53
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)

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.

Re: More functional C#

#54
While sprinkling a few expressions like this around is nice, it's quite a chore to embrace a true dataflow or similiar functionally typed design through your whole application, because the types in c# are so verbose i.e.

    public Generate(TState initialState, Func condition, Func iterate, Func resultSelector, IScheduler scheduler)

Re: More functional C#

#55
post #23

Earlier quoted context omitted.

C# is a great language, in fact, I believe it's the best "general language", if there ever was one. The only real problem C# has is it's bad support of non-Windows platforms. As a language, it's excellent.

Xamarin

ahh no good! C# + X-Platform = #Remarkable

Re: More functional C#

#56

Earlier quoted context omitted.

You're not hanging around in the right circles then, I hear complaints about C# all the time ;). While there's plenty of limitations and frustrations you can run into with C#, I've generally felt they were largely due to intentional tradeoffs I can understand, and fail to know a better alternative to. This makes me significantly less ranty about it, in contrast to my other daily bread and butter of C++. Even if I fel…

Am currently reading "Thinking Fast and Slow" by Kahneman, this is a perfect example of a base-rate fallacy (something addressed in the book). Absent any other evidence, one should assume the amount of complaining a language would get is about proportional to how widely it's used. So the lack of complaining (asserted by the parent) about C# might be as much a reflection on how widely it's used, than on the language i…

> Am currently reading "Thinking Fast and Slow" by Kahneman, this is a perfect example of a base-rate fallacy (something addressed in the book).

I disagree that Dewie's individual experience constitutes a "base-rate". If you're referring to something else as a "base-rate", you'll have to spell it our more clearly for me, as I'm having difficulty seeing how to apply it validly here.

> Absent any other evidence, one should assume the amount of complaining a language would get is about proportional to how widely it's used.

That's reasonable, and my own experiences and anecdotes don't turn out to be capital D Data. However, neither are Dewie's experiences and anecdotes. And what I would argue isn't reasonable is assuming the amount of complaining that one individual developer hears about a language we get is about proportional to how widely it's used. The data set is far too small to extrapolate that far.

My own experience is that the amount of complaining about a language I hear about varies wildly by what my peers in my communities happen to be using at the time. I went years without hearing any complaints about PHP... and then someone gets employed writing it and it spikes up to the language I hear the most complaints about. I'd be very absurd to assume that PHP went from not used very widely at all to the most used language in that same timeframe!

While I cast a wide net, my time is finite and I pay more attention to some communities than others, quite understandably biasing what I hear significantly.

> So the lack of complaining (asserted by the parent) about C# might be as much a reflection on how widely it's used, than on the language itself.

Granted, but "might be" is a far cry from "is" or "should be assumed to be". Indeed, I wouldn't suggest that "C# might generally be less rant-inducing" to be worthy of assuming either. Dewie "might be" not hanging around .NET devs, but even that's a terribly poor assumption -- I know plenty of devs who don't complain about languages I consider absolutely terrible.

Re: More functional C#

#57
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…

Whitespace insensitivity and inability to return void in generic contexts are "critical flaws"?

Anyway, no one's saying C# is flawless. Personally, I would love the ability to declare immutable graph references.

Re: More functional C#

#58
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)

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 to either declare delegates or explicitly declare each of your anon signatures; and KeyValuePair and Tuple both force you into sometimes excruciatingly, comically long object declarations, eg

Tuple, IEnumerable>

I've come to a point where I can comfortably write functional code in the language (though I should stress that I don't write "pure" functional code; I don't fall into the camp that abhors side effects in all scenarios). Day to day, it really is a fine language to work in, notwithstanding a few warts. In all honesty though, I'd rather be working in Python or a LISP most of the time

Re: More functional C#

#59
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)

An obvious complaint is that code like the OP's won't even run because it isn't pointlessly wrapped in a class ("class MyProgram").

Re: More functional C#

#60

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".

You're not giving mono the credit it's due.

I think Mono is great. It's just not a big market but of course it has great potential.
Post reply on HN