News for hackers. Stuff that matters.
Re:“Mostly functional” programming does not work by userbinator on Sunday April 27, 2014 @09:22AM (#7654948)
The average programmer would [...] because that's the way the program was written, as evidenced by the semicolon between the two statements.

Seriously? I don't even know C# and the "var q0" was enough to suggest the type of whatever Where returns is not an array of int (as opposed to the two functions above, with int and bool types), so why would I expect it to have filtered the array and returned it?

Ditto for the 2nd example: in this one it's even more clear that Select is returning IEnumerable<int>, not int[].

In C# the using statement causes the variable initialized at the entry of the block to be automatically disposed of when control flow reaches the end of the block. [...] surprising exception far away in time and space

There should be nothing "surprising" about that; maybe it is if you don't know C#. One of the first things that beginning C and C++ programmers learn rather quickly is never to return pointers to local variables or put those someplace where they'll need to be used after the function returns. How is this any different?

Imperative programs describe computations by repeatedly performing implicit effects on a shared global state. In a parallel/concurrent/distributed world, however, a single global state is an unacceptable bottleneck

Except that this "global state" is not really one thing, and it's not like all of its parts are modified by any one effect.

It appears that this "fundamentalist functional programming" the article is advocating is attempting to make programming more like math and distancing it farther from the real world by adding more abstraction, and if anything, I think abstraction is one thing that a lot of software these days needs far less of.

(Sorry if this is too rantlike, I have somewhat of a visceral reaction to these "the sky is falling!" style of articles...)

Re:“Mostly functional” programming does not work by MichaelGG on Sunday April 27, 2014 @09:53AM (#7655040)
It is possible that Erik has a better (or more cynical) idea of the "average programmer" than you or I might. I'm of the opinion that so long it makes sense and has an elegance to it, then it's fine. If "average" programmers can't handle it, they can use another language or something.
Re:“Mostly functional” programming does not work by metasim on Sunday April 27, 2014 @10:28AM (#7655179)
I can't substantiate this, but my sense is that the generation of general-purpose, non-academic programming languages C++ lowered the barrier to writing software in the industrial context (think VB.Net, etc.). This can be seen as a good thing in these business contexts, but for those who are driven to be deeper and more concise in their problem solving, and are interested in solving more challenging problems, are only starting to realize that we've not been expecting enough out of our languages and compilers. Furthermore, the last two decades of software tool development have gained "lowest common denominator" accessibility at the cost of "dumbing down" the ways we generalists think about and solve problems. The first thing that picking up Scala did for me was realize I was expecting way too little from the compilers I use. Why should I be figuring out what the damn type of a value should be (while not throwing out types all together)!?!

Since Meijer is as an employee of Microsoft I'd extrapolate to say he's heavily influenced in his experience of the "average programmer" by the primary clients of his company.

Re:“Mostly functional” programming does not work by endeavour on Sunday April 27, 2014 @09:42PM (#7657810)
He no longer works for Microsoft
Re:“Mostly functional” programming does not work by userbinator on Sunday April 27, 2014 @10:37AM (#7655219)
I think his idea of "programmer" is closer to "mathematician" --- and indeed if you think in that manner, functional programming looks perfectly natural and obvious. The problem is how many of the programmers - and by that, I mean anyone who writes instructions for a machine - actually do think like mathematicians; and in my experience, not as many as the ones who can easily grasp the sequential, imperative model of machine execution. Not to say that thinking of computation as a function that takes an input state and produces an output state is conceptually interesting, but I think that's a bit too abstract for a lot of people.