Why is imperative programming still the most widely understood and used form by far (despite its certain weaknesses)?
Because the world, in most cases, is sequential. Understanding of time and tenses are very important for navigating life. We learn to process in sequential style from babyhood (and likely over evolutionary time as well).
Mathematics (anything beyond basic) and functional programming are hard for 99+% of population and more than half of programmers. (People here are above average, so your mileague may vary.)
Functional programming corresponds to the Present Simple tense in English. The tense is not that common in everyday conversation and we rarely see it in complex sentences apart from technical/scientific writing. No wonder most people have little training for such style of thinking.
I think you're "almost" right. The world is not quite sequential - the world is composed of a vast quantity of concurrently running agents which communicate through a message passing system. Not unlike a many core system running sequential tasks and using a message passing system. Or a dataflow system where the data stream could be seen as messages being passed between concurrently executing operations.
You are right, though: we work and think in a very sequential manner. Once you introduce concurrency to any everyday life aspect, it becomes more difficult for us to grasp. Even cooking is difficult when you prepare multiple things at once and must remember the timing for each of these things and schedule your time or the work between multiple cooks.. with practice, its not so bad - programming is the same, it gets complicated when you stop using a sequential paradigm, but with practice other paradigms can become natural too.
It is also for this reason why I think the "ultimate language" (tm) would be a mixture between something like dataflow and sequential programming, offering the programmer the choice to use whichever style is most natural to the task at hand, without having to put much effort into splitting the program into components of either category. I have started to see languages moving that way, slowly, though I think it'll be another while still before they're usable enough to replace currently popular languages.
I'm reluctant to characterize the world as being composed of independent agents passing messages. I can't put my finger on it exactly, but it just feels like a very lossy oversimplification.
Can you elaborate at all? I'd be very interested to hear (since this is a topic I find quite intriguing).
For humans, we ourselves may work sequentially, but there are many of us working concurrently. Like many many sequential processing cores. Perhaps your comment was targeted at the "message passing" aspect. Its a bit of shared state mixed with message passing, really. Often we interact directly - I could tell you something (message passing) or I can shout something (multicast message passing). Of course, we also operate in a shared state model: multiple people taking food from a plate, we have to synchronise this so that we don't clash (physically, in this case).
If I were to conceive of the universe as a program, I would think of it as one giant state with a few fundamental particles and a simple functional program that resolves the state over time based on the previous state.
Passing messages to me implies a finite set of messages and pre-conceived interaction, whereas in reality there is no such thing as discrete objects or interactions, everything interacts with everything, and the world we know is emergent from the low level physical properties.
I suppose there could be an infinitely polymorphous OO program behind the universe, but that just doesn't strike me as a good fit with what we know about physics.
I never meant to imply OOP when I said message passing. I guess it was the wrong term to use, because its got too much of an OOP ring to it. What I mean is that events or packets of data or what have you are passed between independent agents. The communication is loosely coupled fropm the agents and the agents all function independently (they often work together, but the "function" independently).
If I say "Hello, Bob", this "message" or communicatable data is passed from me to Bob. But coupling is also low - Mary and Peter, who are standing nearby, can also hear this - unless I whisper.
Basically, the events or messages or data packets or whatever you want to call them are simply sent OUT for whatever to pick them up and do with them what they will. The messages can be directed though (say to Bob vs simply yell) and the listeners can be restricted (whisper). In this respect, I see the world as independent threads of execution which communicate through some (anonymous, if I hear someone yell "Fire", I don't care who) message dispatch system. Something like this: http://didntread.files.wordpress.com/2009/07/components.png
People are made up of sub-agents, which themselves are made up of smaller, independent agents and so on. Cells communicate with nearby cells through proteins and chemical reactions and electrical signals - these are messages being passed (anonymously) between agents.
Now, if each agent was a single thread of execution, then you have discrete points where communication and interaction occurs. You said that this is not how the world works, and you are right. Imagine instead a network of connected operations, where when one operation produces some result, it passes it to all the connected operations. When an operation has received all its inputs, it can execute - concurrently, in parallel with any other operations which also have their dependencies met. At some point, these operations too will complete their processing and their output is propogated to connected operations. In such a system, when a message is received or when an interaction occurs, the network of operations (the agent) can process it immediately. No longer does the agent have to wait for a certain discrete point in a sequential processing system to communicate or interact - it can do so as soon as some data is available. These entworks do contain state, just like you said the agents in the real world do, but instead of having some fixed memory buffer contain the state (well, technically, you could have that too..), the state is maintained in feedback loops between operations (think of a flip-flop in electronics: the output of a logic gate is fed back as its input, either directly or indirectly through other logic gates).
What I have just described is a dataflow system and THAT is how I think the world works, if it were a programming system.
Note that some things ARE inherently sequential - the operations are still ordered by their dependencies. Maybe the operations themselves process their data in a number of sequential steps. This is fine, because certain things require ordering to make sense or to work well.
Every verb in what you just wrote is in the present simple, with the single exception of "your mileage may vary". It's probably the commonest of all tenses both in everyday conversation and in complex sentences. I see no reason to think that people in general (or programmers in particular) lack experience of expressing things in the present tense. It's also far from clear to me that there's any real correspondence between the present simple and functional programming.
Apart from that, though, I liked your last paragraph just fine.
Good observation on the irony of my own writing. :-)
I should have added abstract writing in general to technical/scientific.
In general, Present Simple tense is used when referring to abstract concepts, which is rarer in real life than in this forum. (A lot of people here are abstract thinkers.) Most news pieces and conversations refer to actual events and do not use as much Present Simple.
Because the world, in most cases, is sequential. Understanding of time and tenses are very important for navigating life. We learn to process in sequential style from babyhood (and likely over evolutionary time as well).
Mathematics (anything beyond basic) and functional programming are hard for 99+% of population and more than half of programmers. (People here are above average, so your mileague may vary.)
Functional programming corresponds to the Present Simple tense in English. The tense is not that common in everyday conversation and we rarely see it in complex sentences apart from technical/scientific writing. No wonder most people have little training for such style of thinking.