5 ms·
I'm hearing a lot of praise for PHP frameworks such as Laravel, but I'm not sure PHP should strive to become more like RoR and Node.js. Rather, PHP's unique sel
by tannhaeuser 7y ago
I'm hearing a lot of praise for PHP frameworks such as Laravel, but I'm not sure PHP should strive to become more like RoR and Node.js. Rather, PHP's unique selling point, for me anyway, is its use as embedded language in otherwise static HTML pages via SGMLish processing instructions (`<?php ...>`), and I think there's nothing wrong with that even with the current preference towards Ajax and (micro)services. It's just that embedded PHP did such an incredibly poor job (like, not even an attempt) of preventing injection attacks despite SGML having very strong mechanisms for context-dependent escaping and markup validation. Which has given PHP its bad rep as a botnet/DDOS vector, and deservedly so since this has become a long-standing problem for PHP and non-PHP sites alike.
- Isinlor 7y agoMixing PHP, SQL and HTML is ok for 200 lines apps. It does not scale to even 10 000+ lines of code and no one is doing that anymore. Some people are still using PHP just as a template language, but there are still issues with XSS, that one could avoid by default with dedicated template languages like Twig. Current main selling point of PHP are great frameworks and ecosystems, easy to find developers, and share nothing architecture that removes whole class of problems related to memory leaks and scalability.