by vectorpush · 14y ago · 0 comments
Given a poorly engineered PHP or Python project, I will always pick the latter. However, if I were to start a project on my own I'm confident enough in my PHP that the language choice is harder to make.
That's true, but my point is that there isn't such a visceral hatred for C and C++ even though they are widespread and notorious for memory leaks, vulnerabilities, indecipherable corporate quagmires (perhaps due to an over-engineered OO architecture or 700 line functions or opaque symbol names or dependency hell, etc).
Besides the lack of language features like @ (error silencing)
Red-flag bad practices exist on all platforms. The horror story of a PHP project littered with error suppression is like opening up a C project and discovering that the control flow is guided by a 200 label GOTO architecture. It's not PHP's fault that the programmer abuses the language, it's the employer's fault for hiring a highschool student at $15/hr.
C is enormously more consistent, better defined and specified, and well-documented than PHP.
It's a solid enough language with a very specific use case, and not even remotely competing with PHP.
PHP is a terribly inconsistent, poorly defined, poorly documented, poorly implemented, poorly designed language that can't do anything better than any of the other languages it is competing with.
The one thing PHP has going for it is inertia. That's it.
Yes, this is a trite and negligible truth of PHP. A developer suffering any significant loss of productivity due to problems like mismatched needle/haystack parameters just isn't very competent. It's a non-issue if the developer is being paid a real salary. I'm not saying these issues aren't important enough to warrant attention, but the debate between maintaining backwards compatibility and squashing bad practices certainly isn't exclusive to PHP.
and not even remotely competing with PHP.
I already addressed this in my previous post. I'm not suggesting that PHP is in competition with C, that should be pretty obvious. I'm asserting that C, like PHP, is ridden with dangerous pitfalls for developers who don't know what they're doing. PHP is just easier to work with for a novice programmer.
The one thing PHP has going for it is inertia
And did that inertia spontaneously emerge from a vacuum? In the spirit of PHP's namesake you've devised a recursive argument to explain the only conceivable upside to using PHP.
Sounds like Java to me :-)
You get nothing in exchange for the extra headaches of PHP.
Of course you receive something in exchange. Whatever explanation you have for the ubiquity of PHP is the benefit one receives in exchange.
Besides, my point is that headaches are not inherent to PHP. Just because a community of hobbyists and novices churn out shaky code doesn't mean that developers employing best practices will.
https://github.com/symphonycms/symphony-2/tree/master/sympho...
Here is an example of quality PHP code. Clear and organized OO structure, useful comments, self documenting method and variable identifiers. Why is this inherently wrong?