6 ms·
Really? So the main issue with php is a few functions have inconsistent parameter order? Ignore the massive speed improvements, composer package manager system
by ransom1538 9y ago
Really?
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 https://wiki.python.org/moin/Python2orPython3
[2]https://stackoverflow.com/questions/2018026/what-are-the-differences-between-the-urllib-urllib2-and-requests-module https://stackoverflow.com/questions/2018026/what-are-the-dif...
PS. Also, wtf does javascript librarys have to do with php.
- nkkollaw 9y agoWell, I specified "IMHO". That's the main issue that I have 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.
- ransom1538 9y ago"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" 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-html-decoding-encoding-using-python-django https://stackoverflow.com/questions/275174/how-do-i-perform-... Java: https://stackoverflow.com/questions/5741311/how-to-encode-special-chars-in-html-content https://stackoverflow.com/questions/5741311/how-to-encode-sp... Go: https://gist.github.com/brandonrachal/10605780 https://gist.github.com/brandonrachal/10605780 Rails: https://stackoverflow.com/questions/1600526/how-do-i-encode-decode-html-entities-in-ruby https://stackoverflow.com/questions/1600526/how-do-i-encode-... c++ (get your own sax ready!): http://forums.codeguru.com/showthread.php?448809-C-Replacing-HTML-Character-Entities 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.
- Mithaldu 9y agoDoes stacking of PHP's ternary still result in hard-to-predict behavior?
- _cereal 9y agoYes, documentation still suggest to avoid such practice, see the second note here: http://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary http://www.php.net/manual/en/language.operators.comparison.p...
- kod 9y agoThe java apache commons example uses methods named escapeHtml and unescapeHtml Seems pretty sensible. How is that not support for the claim that php's method naming sucks by comparison?
- 9y ago
- vrodic 9y agoDo you have a public example that illustrates how PHP/Hack code in Facebook looks like? 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.
- mschuster91 9y ago> being made worse by having to setup everything on every request 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...
- jjirsa 9y ago1) php doesn't have to setup everything on every request - opcode caches, process pooling et al exist 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
- cagataygurturk 9y agoBootstrapping a project with Spring Boot is 10x easier than dealing with some modern PHP framework's setup and nginx stuff.
- TomMarius 9y agoI usually just create a VM from a DO template and that's it, no NGINX stuff (although it's very easy, NGINX has good documentation and sane and working default configuration).
- jjirsa 9y agoFlat disagree. The php framework is going to run on every shared host in the world, and sprint boot isn't. I'm not saying PHP is better, I write java all day every day, but if I had to build a website for a random friend or family member, I'm writing it in PHP, because I know their hosting will run it.
- gigatexal 9y agoConsistency in a language goes a long way. In the end it’s programmer efficiency that matters more than performance
- tyingq 9y ago>PS. Also, wtf does javascript librarys have to do with php. 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.