I've tried Node when the trend started and it was okay. But the problem was that the actual script was also the server. So if the script hanged, the whole server hanged. Went back to PHP and never looked back.
(2015)<p>Btw while this code doesn't win a prize, I agree with the author that functional style is worth it in many cases, even for a language as wordy and cumbersome as PHP. I still love PHP - its deployment story is still unparalleled and its standard library came batteries included since forever.
writing/thinking in FP style since 2020. Elixir, Js, F#, Julia and even PhP. Never got back to OOP. Never needed to. I realized what a waste of time and frustration had been OOP for me for almost 15 years (Java, C#).
You can write OOP-style in C, FP-style in C/C++/Java or even PHP. Sure.<p>Writing pure FP code (pushing all the side effects to the "edges of the program" in C is possible! But it's going to take a lot of discipline from the programmers: there is no safety-net and lots of dreadful boilerplate.<p>Impracticle, but possible.
tl;dr: Hardware is cheap. Engineers are expensive.<p>> Instead of fearing the overhead in PHP for function calls,<p>Already in 2015 in almost all applications this is a premature optimization which is rightly known as the root of all evil. Please. Your app will talk to the network, likely run a database query which is like thousands or millions of times slower than a function call. Further, even if there is a measurable difference the cost of hardware which makes that difference go away is very likely to be smaller and much smaller at that than the cost of the engineering hours wasted during maintenance when wrestling with code which was written with a "function calls are expensive" mindset.<p>This doesn't mean you don't need to worry about performance and scalability but even that is going to be much easier if you have a well structured code.