by DarkNova6 · 2y ago · 0 comments
It surface seems productive and shiny and for 90% of use-cases you get the job done quickly. But for those other 10% you realize that at its center lies a rotten heart, wired together with duct tape. Syntax is not the problem. Horrendous stdlib and IO interop is what keeps it a mess.
Once you try to do anything more sophisticated you realize its many sharp angles which don't make sense. Such as call-by-reference only working 2 recursions deep. Silently failing when opening files which are too large. Arbitrary decisions and namings on stdlib. The hassle of debugging your program.
Or an ongoing struggle in my old company: Wanting to set up old PHP projects and realizing that your package manager doesn't have them anymore.
PHP is a ticking time bomb.
When it coems to running different PHP versions, modern PHP development has largely moved to using Docker (ddev, for example: https://ddev.com/) for that, and there's plenty Docker images for old PHP versions so it's a non-issue. I'd also imagine it be difficult to get many other outdated programming languages via a package manager.
There's now the PHP Foundation, which while relatively new in its formation, has significantly boosted PHP development and I'd recommend donating if improving the language is important to you.
Java & Maven is extremely stable. It is the exception rather than the rule that something doesn’t build anymore.
> I'd recommend donating if improving the language is important to you.
It's not (-:
Which smells like an anti-pattern to me. Blaming bad code on the language is one way to deal with it.
> Arbitrary decisions and namings on stdlib.
This is absolutely true and even more annoying I find that the ordering of stdlib arguments is inconsistent. Backwards-compatibility is one of the reasons this has not changed, I guess.
What I don't understand is, why people don't apply that same legitimate criticism to python. I recently had to do a project in python and was astounded by the amount of arbitrary namings and design choices.
I also agree that many php codebases, especially if not written in a good framework, are a hot mess.
That being said, the ecosystem if using decent frameworks with php 8+ versions very productive in terms of time vs results and a joy to work with.
I absolutely do. I appreciate the PHP community for having expertise in actually creating sane tools attempting to do a good job. But Python is just batshit crazy with some of the most wild bugs I have seen and no guardrails whatsoever.
Out of all the languages which got a type-system after the fact, PHP is the best one hands down. Runtime-validation of types + non-null by default keeps some of the bad stuff inside Pandora's box.
> Which smells like an anti-pattern to me. Blaming bad code on the language is one way to deal with it.
It was a simple recursive algorithm which we used to make some custom-highlighting on a few select words (much easier to understand than an equivalent iterative approach). But I wasted a good day until I saw that there was a technological limitation which made the algorithm fall apart, and not the logic itself. That's a quite offputting smell.
Of course I understand the economic choice behind PHP... finding PHP programmers is cheaper than going C# or Java. But having a good background in parallelism and having a good grasp on efficient CPU/JVM usage PHP doesn't provide anything unique. Everything it provides, I can achieve equally fast in other established languages, while posing an actual problem when technological limits are reached.