3 ms·
Ask HN: Why did not declarative programming win through?
In web development I made the experience that many imperative concepts were replaced by more elegant and efficient functional ones.
On the server side we had scripting languages spawning a new thread per request, ending up with thousands of threads.
Then came node.js with one thread per core and asynchronous APIs to handle these requests, but now we had code full of callback hells.
The solution were promises, comparable to Haskells monads.
On the client side there are functional-reactive / virtualDOM-based frameworks like React, scaling a lot better with performance and complex state than traditional MVC frameworks like Angular and Ember (using lists of watchers/observables to update the DOM) or even VanillaJS applications, despite of having to compare two complete virtual DOM trees (which can also be avoided by using lazy evaluation with immutable data structures).
All this abstraction done by the frameworks seems to be more efficient than code written manually.
Why are we still using all these imperative languages and concepts?