4 ms·
PHP at its core is the best part. A whole bunch of optimized and well tested C functions that are typical of backend functionality. If you can do as little as
by JimmyRuska 5y ago
PHP at its core is the best part. A whole bunch of optimized and well tested C functions that are typical of backend functionality.
If you can do as little as possible in PHP and rely on the low level functions to stitch together what you need, deserialize and render data in the front end, use front-end templating, then PHP is insanely fast, practical language.
The issues with PHP are usually when people build out giant frameworks in PHP, rather than using PHP as a higher level glue language for the built-in fast C functions.
- blowski 5y agoI've worked on _many_ PHP projects. Unless it's a small single-purpose script, if you tell me it doesn't use one of the standard frameworks, I'm going to assume it's an absolute unholy mess of spaghetti. Laravel and Symfony are both extremely good, and the only reason people don't use them tends to be out of misplaced arrogance. Unsurprisingly, they end up building their own awful framework, and at some point the project either dies or someone says "Erm, we should put this in Laravel". There are some people who've built great projects without these frameworks, and there are many projects in these frameworks that are terrible. But in terms of probabilities, you've got a much better chance of a project being well-built if it's in Symfony or Laravel.
- holoduke 5y agoI have seen plenty of PHP projects without any frameworks used. Big ones as well. One of these projects is automation for a complete manufacturer factory. Robot controllers, Serial hardware drivers written in PHP, Realtime application with PHP instances running for multiple years. No frameworks used at all. There is more than only webapps.
- blowski 5y agoI’m sceptical that’s a large proportion of PHP projects, and thus comes under my caveat of _some_ projects.
- Koffiepoeder 5y agoTo be honest, I quite like modern PHP. On the other hand, I tend to stay away from it, exactly because of the big prevalence of spaghetti code projects. There just is so much legacy in the PHP world that separating the wheat from the chaff in itself becomes tedious. And don't understand me wrong: legacy in itself is not a problem. It's the combination of PHP being easy to pick up, lots of outsourcing, people writing procedural code without any notion of code readability, lack of tests, use of global state, etc that usually just make me cry and move on. For me the percentage of worthwhile PHP projects to chase is too low in comparison with many other technologies. Even though PHP was what got me into programming in the first place, I nowadays thus chose to pick other battles. But every once in a while I still nostalgiously float back in time to my childhood days, enjoying every line of the almighty 4MB imagemagick monstrosity scripts I conspired. And then I'm happy that you nor I have to solve these enigma puzzles.
- blowski 5y agoI started with Ruby, and I imagine my code there was just as bad. But I totally agree about the prevalence of bad PHP projects. My theory is that it’s the dominant language and so there are just more projects, and (like the opposite of survivorship bias) shit codebases are often looking for good developers to save them which is why you see so many of them.