by ransom1538 · 9y ago · 0 comments
So the main issue with php is a few functions have inconsistent parameter order? Ignore the massive speed improvements, composer package manager system or huge community. Good companies use php. I haven't met someone at facebook that can't code it. (please spare me the HHVM comment or how your intern friend does haskell in the basement).
Have you read about python 2 vs 3? Have you actually seen real programming language issues? Or tried to scale rails? Or worked on deploying java with 30 other people? Tracked a memory leak in c++? Been thrown into callback hell of node? Have you tried to get stackoverflow answers while developing in MEAN.
IMHO people are just justifying their own stack (while secretly suffering with python - a 26 year old programming language) [1][2]. In reality they know php can do anything web / probably in less lines, portable, with easy to find information, with a strong community, in less time, faster. I will let everyone get back to figuring out what the difference between urllib and urllib2 is in python.
[1]https://wiki.python.org/moin/Python2orPython3 [2]https://stackoverflow.com/questions/2018026/what-are-the-dif...
PS. Also, wtf does javascript librarys have to do with php.
I have no idea what they do at Facebook, and I don't have to work on the biggest community in the world that often.
The problems I encounter in term of performance for websites/apps are along the lines of pages being super-slow because of the 100 JavaScript frameworks we like to use nowadays for the smallest of projects, my clients uploading 10MB images that get resized via HTML and still load at full-resolution, etc.
As for coding yes—one issue I have is that not using PHP exclusively I get confused by the fact that the opposite of html_entity_decode is htmlentities and not html_entity_encode, and that slows me down for no apparent reason except the fact that 20 years ago one guy added htmlentities and another guy html_entity_decode, and no one thought about aliasing or deprecating one of the two to fix the unintuitive naming.
Ah yes. You will probably have to hit 'tab' on your IDE with php - to type "html_entity_encode". But if this is too hard - Here you go,
Try it out in python (careful of the 2/3 quirks!):
Python: https://stackoverflow.com/questions/275174/how-do-i-perform-...
Java: https://stackoverflow.com/questions/5741311/how-to-encode-sp...
Go: https://gist.github.com/brandonrachal/10605780
Rails: https://stackoverflow.com/questions/1600526/how-do-i-encode-...
c++ (get your own sax ready!): http://forums.codeguru.com/showthread.php?448809-C-Replacing...
Again the anti-php movement in action. A bunch of devs who used php 15 years ago.
Seems pretty sensible. How is that not support for the claim that php's method naming sucks by comparison?
Why are you arguing against a strawman?
My problem with PHP is that most of modern frameworks seem to take a lot from Java, and people have started to use type hinting whenever they can, so the code looks like (uglier) Java, but without advantages of performance (being made worse by having to setup everything on every request) or compile time type safety.
That does have advantages though, I have yet to see a popular PHP application break down due to memory leaks, compared to almost all Java code I've seen eventually ending up in memory bloat...
2) the benefit of php over java is that php is going to run everywhere with no effort, and running that same java based website/service is going to start with some doc on installing tomcat or similar, which will devolve into chaos as you start working with ssl certs or shared servers
The reference is likely pointing to the idea that individual url response times or throughput isn't the whole story. A php site that can do 1000 transactions per second may outrun a nodejs site that can do 3x that, if the individual pages drive fewer xhr requests per page. Or the client side js may be so bloated that the page doesn't render any faster if you make the back end faster. I've certainly seen SPAs that stall parsing/executing js for longer than the remote requests take.
Sometimes client side matters more than server side.