Beautiful JavaScript – Functional JavaScript
Like a lot of people, I&#x27;m drawn to the idea of functional programming, and I enjoy using the functional building blocks in JavaScript. What I struggle with is performance, and I bump into it all the time. The difference between overwriting an array with a for loop and using map() is roughly an order of magnitude. I use map() and other functional primitives whenever I can, with anything small and with any code that doesn&#x27;t need to be fast - which is admittedly most code. But performance matters often enough that I can&#x27;t adopt a single functional style even though I wish I could.<p>Will there be a time when going functional will be not just the fast way to write code, but the way to write fast code? Are there efforts to create high performance functional primitives that are easy to use and also outperform their imperative alternatives? I&#x27;ve used numpy, for example, and I wouldn&#x27;t necessarily put it in the easy to use category. I&#x27;m hoping one day I can write straightforward functional code and have it not be so much slower than imperative code that I have to question which one I should use.