Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I don't see php hate at all. But I could name a few reasons if I had to. But I had a lot of fun with it for years.
-
I think the only thing that doesn't suck about PHP is that it has actual pass-by-reference instead of Java where people think its by-reference but it's actually always by-value
Not that pass-by-reference is all that good, but at least it's interesting... I don't think I have much more good to say about php lol -
@3dgoosee Personally I can’t speak about php because I never used it in practice.
But from what I hear and read about it, it sounds like a similar clusterfuck as JS, but more on the side of std lib design than the actual language design. -
It's ugly, and not opinionated. I think most hate is because of that. And also it has some weird stuff like T_PAAMAYIM_NEKUDOTAYIM
-
It allows for ugly solutions and workarounds that the most purist ones will hate, and the humorous ones will joke about. But at the end of the day, it's never about the tools.
-
I've heard it's gotten better too, but it has so many design problems that you see things like Hack and Hiphop (not sure which if these is even maintained anymore). /r/lolphp use to be a good list, but it's gotten less meaningful since PHP7/8 apparently started leaning up a lot of the garbage.
But back in the day, all functions were in the global namespace, there was no version of === for >= and <= (strong type checking), making stable sorting for mixed types impossible. The type inference was a complete mess (Python2 was comparatively sane) ... a lot of other stuff. It's the ColdFusion of the open source web programming languages. -
From what I've seen I reckon it scores poorly on all four metrics:
1. How easy is it to slap something together that superficially works but is actually shit? (Far too easy.)
2. How difficult is it to build something elegant and robust? (Extremely hard.)
3. How bad would the slapped-together solution be? (Terrible.)
4. How good would the elegant and robust solution be? (Mediocre.)
It's the combination of #2 and #4 that do it for me. It's just not worth the effort. -
glowFX1732dIn the web context I hate its stateless architecture: For every request it always parses the whole code (yes you can use caches) and always does the complete "initialize + execute + shutdown" routine.
That's inefficient and needs to be considered when building a proper service. -
@glowFX
Not that I want to defend php, but the situation you described is exactly what php-fpm was made for. -
hjk10155771dThe main reasons are
1. it's an older language. You will see the hate for older languages all the time. Things they used to be bad at linger while not true anymore. Some mistakes are fixed by adding new stuff but need the old stuff for compatibility. You can see this in Java and JavaScript too.
A lot flak in the standard library being inconsistent is actually PHP being consistent with the POSIX functions they wrap/emulate. Inheriting those mistakes made sense at the time it was supposed to be scripting with C. PHP just allowed you to skip a lot of the tedious parts and you write the high performance parts in C to tie in.
2. Part of it's success comes from being an easy language to install, learn and use. This has the downside of a lot of terrible programmers that can, but really shouldn't use the language in production.
The absolute amount of insanity that is pushed out is vast. I've only seen this type of shit with electrical engineers trying to program a microcontroller. -
hjk10155771d<Continued>
Since PHP 5.4 it's an ok language if you know how to set up opcaching and class autoloading/namespaces. From PHP 7 it's actually a really good language. It's very performant and enforced type hinting makes it a lot less ambiguous without having to fight the type system where you actually need the flexibility. -
gosubinit409722h@donkulator I tend to disagree, it is not about the tools. One can implement a shit architecture and code design using any language. As a matter of fact, Facebook was made initially in PHP (vanilla as far as I know), and it was pretty stable and robust (my perspective as a user).
Related Rants

Source: /r/ProgrammerHumor
Why so much hate on PHP
question
php