Attached: php.png (360x258, 3K)
What's the reason everyone hates php? Is there anything it can do that javascript can't do?
Leo Fisher
Daniel Flores
They hate learning how it works because it's so weird. Spend a few months on a single project and you'll have mastered this language. Anyone who complains about php in this day and age is a nodev
Hunter Wood
More like anyone who uses this crap is a retard
Sebastian Gonzalez
Why? It gets the job done. I mean if you’re not an oldfag you’re going to learn something better like ruby or node or python but if you’re older and you learned php there’s no real reason to change. It just works
Sebastian Cooper
Because 90% of the things in "A Fractal of Bad Design" are still relevant.
Luis Reed
In our country its the most demanded skill in IT Industry, even more than java
Jason Murphy
My only real beef with PHP are the shitty inconsistent naming conventions.
I don't know enough about NodeJS to compare it, technically, but I doubt any Node backend framework comes close to touching Laravel.
That said, I'd welcome a Laravel-like Node framework so I can use the same libraries client-side and server-side if need be.
Brandon Anderson
Tons of security vulnerabilities.
Terribly slow. It used to be 20x slower than node.js, but now days I guess newer versions are closer to 5-10x slower, but still much slower.
No, it can't do anything that JS can't do.
t. have done tens of thousands of lines of programming in both and would never touch PHP again.
Nicholas Howard
They don't know how to use it properly.
Evan Kelly
>have done tens of thousands of lines of programming in both
Doubt.
You have no idea.
You didn't have the decency to _at least_ take a look at php7 vs nodejs performance tests from internet idiots.
Adam Thompson
When PHP is faster than node.js, it's only slightly faster.
When Node.js is faster than PHP, it's often 5-10x faster.
>benchmarksgame.alioth.debian.org
Juan Lewis
It's a good language.
Jordan Cook
It's easy to use and tolerant with fuckups. It runs from top to bottom at a tolerable speed. But node just lets you do so much more due to its nonblocking nature.
Joshua Cooper
Which country?
Logan Ward
Pakistan
Thomas Allen
Inconsistent
Terrible syntax
Terrible hacks on top of hacks on top of patches on top of hacks, making almost every function in the STL have about 5 different variants
Leads to buggy and messy code
Hard to maintain, hard to debug, hard to reason about
Unsafe
Dominic Long
My own humble opinion why people hate PHP is because it's not a 'declarative language' but an imperative one - meaning if you've ever spent time minutes trying to read someone elses PHP you want to kill yourself after 10mins, because it far less readable. But i think PHP is great, Laravel is a strong framework, I still use it because it's easy to use out of the box.
However the world now loves JS for absolutely everything and while its nice to think only in JS for full stack, you cant use JS out of the box anymore!! So much fiddling around with your dev dependencies and environment, e.g. transpliing, linting before you can do a damn anything. I started a project from scratch the other day took us three hours to decide on everything, what framework, dependencies, environment, it's too much for a stupid simple web app. Not good when you're senior dev carrying others, including 'diversity' hires. I am 'falling down' oldfag expecting to be axed any day.
Ryan Evans
That doesn't mean Django, Node or Rails or Asp get the job done quicker and with a lot more options of efficient and up to date libraries. Most PHP libraries are crap from WordPress era...
Landon White
Inb4 racist comments from butthurts
Levi Rodriguez
people hate php as it makes back-end dev easy enough that a middleschool student can create somehing as advanced as Jow Forums with little to no difficulty.
Most people in programming don't want their job replaced, so they spread these memes that php is bad so noone would use it
Nathaniel Ramirez
>slightly faster.
2.63 vs 4.22
41 vs 61
12 vs 16
0.12 vs Error
All I see is that the benchmarks are half and half and probably implementation dependent.
The one thing that is sure is that nodejs needs a shitload of memory.
now check this thinkmobiles.com
>As you can see PHP is faster than Node.js in:
>
> Concatenation of strings
> Filling array
> Filling associative array
> Reading the file
> MySQL query
>Node.js is faster than PHP only in adding numbers.
and bellow that
>Nginx 11.7 + PHP 7.1.1 FPM vs Node.js
> PHP + Nginx – 32 ms
> NodeJS – 200 ms
>slightly
Levi Price
>racist comments from butthurts
Being from pakistan gives others... butthurts.
Gabriel Reed
DELET
Luke Rivera
Node.js is a fucking single threaded event loop. Who in their right mind would host something on something so fragile where your whole server would go down, all connections dropped because of an unhandled exception is beyond me.
PHP 7 is great. Frameworks like Laravel make it even more so. It's blows the fuck out of Node.js in terms of performance. nginx proxy caching and server load balancing is awesome. There's really no reason not to use PHP other than for small node.js projects.
Hudson Hernandez
>thinkmobiles.com
I saw that.
Doesn't mean shit. They're doing things wrong to make JS slower.
Like in one case, they keep increasing the size of an array, which is heavy in JS, when they already know how large the array needs to be and should have made it that size at the start. Fucking retards like you.
This is over fucking 3 times faster. This would make it drop to half the time in php.
Like actually kill yourself if you're this stupid to not see how bad their "muh performance benchmark" is.
The only way you can truly measure performance between languages, with wildly different features, is to make two compareable apps with high tier programmers of each. If you think it's all down to certain array and math function speeds, you're an idiot. JS applications are often faster than C++ applications due to features of JS that would take a lot of work to implement and optimize in C++ applications (like object proxies, and optimizations that the VM does).
Fact is that apps written in node.js, like ghost, are faster than ones written in php like wordpress and drupal.
Fact is that almost every major tech companies like Google, MS, Netflix, and so on use nodejs instead of php, despite them being about equally easy to make an application with.
Jacob Clark
>drops to half the time compared to php*
Their JS example was 41.42ms average on my machine compared to 87.262ms on their slower machine. So my machine is double twice as fast.
But my correctly written example is 11.97ms, so on their machine it'd probably be around 25ms, which is twice as fast as their PHP.
Worth noting that on Mozilla's VM instead of Google's, their example is also about 3x faster anyway, so faster than PHP.
Shit's cherrypicking and meaningless, though, because you can look at webapps written in php and node.js and see that the node.js ones both handle more users, are more responsive, and are more feature rich. Oh, and more fucking secure.
One of the biggest bullshits they're doing is not counting the execution overhead of initiating php while node.js runs as a daemon, too. This is huge.
Owen Gutierrez
>if you've ever spent time minutes trying to read someone elses PHP you want to kill yourself after 10mins, because it far less readable
yep. my complaint is more basic. i still can't get over having to shift + 4 every time i want to create a variable. one could easily implement interpolation without requiring that the dollar sign precede the variable in declaration or assignment.
//ideal:
i = 3;
echo "value of i: $i.";
echo "dollar sign: \$";
Charles Nguyen
This EFFICIENT son of a bitch is STREAMLINING back-end development daily, and basically, you are fucking stupid
Owen Sullivan
how do you explain the slower file reading then
Christian Walker
People hate PHP because 80% of websites use it. It's the easiest language to setup and you can embed PHP code in HTML. That means that a lot of people write PHP, including the unskilled ones.
PHP 7 is a good language. It's fast enough that it doesn't matter. Your first bottleneck is going to be your database. Laravel is the best web framework out there, it has more features than Rails. For 99% of projects you dont need horizontal scaling and simple PHP/Laravel/MySQL btfo anything out there.
Javascript is worse language than PHP. Class keyword is a hack around prototypal inheritance, bitwise operators are useless and same goes for with keyword. Too many places to shoot yourself in the foot.
Regarding code quality, imagine bunch of front end dev, jquery users, writing server side code. It's worse than the old PHP. Not to mention that in most cases MySQL is better than MongoDB, default db choices for each language.
Javascript ecosystem has nice things like Meteor, V8 engine is fast and it's nice to use the same language for frontend and backend.
Elijah Cox
>they keep increasing the size of an array, which is heavy in JS, when they already know how large the array needs to be
js developers...
that's a scenario where you increase the array size.
If you make false assumptions for the test, why don't you just create an array of 1 million 's' beforehand since you "know" the size and the "result".
>JS applications are often faster than C++ applications
ok you are just stupid.
Jonathan Thompson
>cherrypicking
how is cherrypicking when you test the most obvious operations that the language targets.
db i/o, string manipulation, memory footprint, file manipulation, e.t.c.?
Jayden Phillips
Wrong.
PHP is server side and has many vulnerable and economic pitfalls. vs JavaScript run on the user side is more cost-effective and less vulnerable server side since the JS output is being fed to tthe server side instead of conditions and values.
Nicholas Morales
It's just like JS and Perl had a baby. Go figure.
Colton Long
es6 is the most out of the box friendly version of Javascript. you don't even need jquery
Justin Bailey
so you are meaning to tell us, that php produces code that costs you money and has security holes. Then you tell us that it's vulnerable to talk to some php backend and several other funny things.
That's why you can't have a talk about programming with people who haven't written at least C in CS101.
Idiots are talking about security and code safety and they don't have unsigned numbers. How the fuck do you know if an index or iterator has an accepted number?
You don't.
OTOH the JS shitty ecosystem is unstable. Libraries, frameworks, e.t.c. are dying every 1-2 years and the whole development is driven only by trends.
Let's use X because is the hot potato right now. A few months later, X is dead.
And ofc for that one that mentioned google and others who use serverside JS... have you ever considered how many projects has been scrapped by google and other "devs" or how messy their apis are and unstable? Are those companies setting a paradigm? No, they have clueless devs who are spitting out code without worrying about quality and longevity.
Joshua Clark
>imperative one - meaning if you've ever spent time minutes trying to read someone elses PHP you want to kill yourself
you want to kys because you cannot read code.
JS and PHP have almost the same programming paradigms.
JS is not declarative. It becomes somewhat declarative is you shit one of those frameworks on it.
Josiah Gutierrez
love how you got btfo but still show your face namefagging
Parker Gutierrez
Well no. Perl 6 is actually good compared to Perl Classic
Well you are just saying what everyone in the industry are thinking. Companies want to fork the bill on the client end to fork out support and all security responsibility at ever corner.
John Hernandez
Perl 6 is like C++ and Perl had a baby.
Luis Cox
> It used to be 20x slower than node.js, but now days I guess newer versions are closer to 5-10x slower, but still much slower.
[Citation Needed]
Also
> node.js
> performance
Backend JS is only a proof of double digit IQ.
Hudson Torres
>It becomes somewhat declarative is you shit one of those frameworks on it.
precisely, frameworks like React, allows you to write in a declarative manner, meaning your code is more 'descriptive' about what it should 'look like', as opposed to imperative i.e. 'this is what it should do'.Which is a bonus for the next person who comes along to read your code because it's then easy to read.
>JS and PHP have almost the same programming paradigms.
Yes PHP & JS are similar paradigm, but you write PHP in an imperative manner but that's what it is.
See: en.wikipedia.org
Now apologise or Brendan Eich will haunt your dreams...
Josiah Russell
PHP doesnt even implement the http stack correctly. No serious company would ever use php, for anything beyond startup phase, actually nowadays i dont even think a startup would touch php with a ten feed pole.
John Ross
I only care about speed. PHP beats all of those. Only golang is a decent contender to PHP.
Nathan Hill
PHP scales like shit. Besides if you really care about speed that much you'd be stupid not to use cgi
Caleb Foster
Any good cgi toots you can point me to?
Adam Fisher
I would much rather spend some more time and money to make my service run more server-side, so on the client-side even the weakest system won't have trouble using my service. Stop being a jew and off-loading all the work to the client-side system.