3 ms·
Technically, that's more like actor-mode concurrency than imperative programming. Anyway, it's dangerous to make generalizations about how people think, becaus
by nostrademons 17y ago
Technically, that's more like actor-mode concurrency than imperative programming.
Anyway, it's dangerous to make generalizations about how people think, because people think different ways in different situations. For example, some people may think: I'll hand in my homework, and it'll come back with a grade on the top. If I get enough As, that results in passing grade for the course. If I pass 32 courses, I get a diploma. If I get a diploma, I get a job at Big Corp. All of these are essentially "functions", where you pass in an input and get back an output.
Honestly, I think the real reason functional programming didn't catch on is because when the computer industry was new, you needed the performance available through mutation. So programmers learned to depend upon it, and when new programmers entered the industry, they picked up the conventions and culture of old programmers, and so on. There's nothing intrinsic about functional or imperative programming that makes one better than the other: it's the network effects from imperative being the default in industry today.
In fact, I thought MIT released some research showing that among students with no previous programming experience, those who were taught in functional languages picked it up more quickly and easily than those in imperative languages. You could make a good case that functional programming is closer to how people actually think, but that programmers' brains have been warped by having to deal with imperative programs all these years.