Live data from Hacker News

More functional C#

news.ycombinator.com

71–80 of 98 posts

Re: More functional C#

#71
post #24
post #7

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

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

I used to use this argument and only now I realize how flawed it was. At some point there were 1000 COBOL programmers for every programmers. If you decide to go with COBOL career, you will be maintaining bad software for years.

Re: More functional C#

#72
post #2

Maybe it's strange for them to see something that is both functional and highly practical? PS: once Roslyn get's finally released, Java will never catch up again.

No one is using Java because it has great features compared to C#. Java is essentially what C# 2.0 used to be and C# has already moved on to V5. People use Java because it's cross platform. When you write server code you want it to be able to run on whatever box instead of paying for hefty Windows hosting. With now Oracle at helm, Java is likely the worst choice for any new project.

Re: More functional C#

#73
post #68

Earlier quoted context omitted.

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.

I know, it's very good. I use Android Studio and PHPStorm, both are mutations of Idea.

Re: More functional C#

#74
post #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)

Methods with that many arguments are probably not a very good idea anyway.

Re: More functional C#

#75
post #7

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

1. Because my management won't let me. 2. Because nobody cares enough about F# to get the tools right (e.g. no ReSharper, no Roslyn for F# on horizon), it feels like a second class citizen even in MS land.

Re: More functional C#

#76
post #21
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 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.

But Python only supports dynamic where C# supports both static and dynamic. It's a good trade-off.

Re: More functional C#

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

>C# is one of the only languages that I can't remember reading any complaints about I've been using C# for about 3 years now. A year or two into using it I thought I was developing fanboy syndrome so I started a list of all of the dumb quirks and pitfalls the language has. Last time I checked, there were only 3 or 4 items on the list compared my python/c++/java lists which have 1-2 orders of magnitude more quirks. C#…

Every good thing has some sort of label attached to it (look at Android now)...

Re: More functional C#

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

"Think of the licensing costs for visual studio, sqlserver and windows server."

Think of the costs of paying your developers. Those things are a pittance compared to the cost of hiring and retaining good developers.

Re: More functional C#

#79
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

> Do you have any examples?

Sure, write a self-executing function in C#.

Re: More functional C#

#80
post #79
post #50

Earlier quoted context omitted.

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

> Do you have any examples? Sure, write a self-executing function in C#.

  ((Action)(() => Console.WriteLine("Hello")))();
or

  new Action(() => Console.WriteLine("Hello"))();
Yeah, it's verbose because you have to cast the lambda expression before executing it, but honestly I don't know any case where a self executing function can be useful in C#.
Post reply on HN