Been programming since the 80s and have used PHP since 2000 (first project an educational tool to help music theory students understand the 12-tone system). I still program with it today although only legacy projects.
PHP is bad. Bad language, bad ecosystem. I even find Perl preferable to PHP.
I don't blame people for using it. Use whatever gets the job done and there's a lot of support for generic backend webshit. Just don't pretend it's good.
Either that or he's posting right from 2004.
Not that either.
So what if PHP has improved? So has every other language and they didn't start out so far behind.
Ecosystem is ok for web stuff but once you step outside of that, so if you want to add something less typical you often find that the only good libraries for doing it are all in other languages, so you end with microservices even if you don't want that.
You can kinda do this with the illuminate support package (included with Laravel by default), allowing you to chain string methods. str($string)->upper()
What I want to know is why did we abandon mod_* integration into apache? mod_perl was how you got high performance dynamic scripting back in the early days, mod_php copied its homework to take over the entire internet, but if you want to use python or node you're expected to abandon the entire workflow and ramshackle cgi, fpm or worse, use the bundled web server instead of apache...
You're replying to a post about why we moved away from Apache mods as integrations with PHP. There are no real direct alternatives to that, and people wanting to be able to use alternative web hosts was the reason we stopped doing it.
Honestly I don't hate the language. But when I walk into some business and inherit a shitty code base, there's a very strong likelyhood that PHP == some guy in India with extremely poor coding skills built this app and now it's my problem.
I don't tend to run into this with other platforms. PHP tends to have a lot of issues with people that did a Durgasoft course five years ago and now write most of its new codebases.
You guys probably think a grandfathered project is something 5 years old.
I have clients fretting that support for php 7.4 is dropped already and they aren't ready to updoot to 8. In contrast, Python hasn't released a major version since 2008. R still supports v3. Clojure has been version 1 since 2009 and is still on version 1.
>I have no idea why PHP gets the hate it does when LETS DO IT ALL WITH JAVASCRIPT exists.
This. PHP is much simpler and looks much nicer than muh JS async hell, yet people say they hate one and love the other.
that's bullshit, all IO operations are faster in PHP because you invoke native extension written in C directly. so first, V8 was designed to be used as a browser runtime. every operation has to get through this browser crust/sandbox/validation before it invokes a native function. second, when designing something to be used as a client application, you're going make heavier use of RAM and caching. you want the complete opposite on the server, smaller RAM footprint being better becuase you are serving more than one user. an idle nodejs process takes about 25MB RAM while a PHP process takes 2MB. that's why the event loop becomes a complete meme because you can just start 10 times as many PHP processes for every node process.
If you're running outside of a browser then you aren't using the browser sandbox. But regardless any fixed overhead for IO is going to be dwarfed by the time spend waiting for the actual IO to be performed.
> an idle nodejs process takes about 25MB RAM
You can serve as many requests as you would like from a single process in node. With PHP you tend to end up with one process or thread per connection (although granted there are ways around with this).
>You can serve as many requests as you would like from a single process in node.
you can't seriously believe that you can run a website with millions of request with one server and one node process. you will have to do multiprocessing with cluster, child_process or worker_threads the same way how you would do it with PHP. except the PHP processes are scheduled by the OS which makes it perform better on multi-core CPUs.
It does look not quite as bad in web. Tech empower has, after meme js and php, standard php at 10% faster than standard nodejs.
Laravel bloat less than half performance of express or koa shit.
In computation benchmark game php gets shat on even by javascript.
Just use go, java or aspnet. Much better performance, better dev experience, more libraries. Java the worst of the bunch and still usable compared to php.
>Just use go
i agree, but those CPU intensive benchmarks are misleading because that's not a realistic use case for a server application. a DB select of 5MB and a json serialization of that data will be faster in PHP because that's just two invocations to C libraries. google results are completely worthless with SEO spam, so i can't find that benchmark unfortunately.
>Duuuuude, just write your entire application in this exact mental gymnastics way or else literally anything you do blocks your entire single-threaded server
Node is naggerlicious.
No, it's exactly the opposite of that. The entire node runtime is non blocking by default so you don't have the problem you get in Python where you can kill your application by mixing blocking and non blocking.
It does look not quite as bad in web. Tech empower has, after meme js and php, standard php at 10% faster than standard nodejs.
Laravel bloat less than half performance of express or koa shit.
In computation benchmark game php gets shat on even by javascript.
Just use go, java or aspnet. Much better performance, better dev experience, more libraries. Java the worst of the bunch and still usable compared to php.
Pretty bad ye but still the only one we have. A lot of it has nothing like real code. >they have static string as current time and send that every time.
I don't hate PHP. However, I very much hate the PHP projects I've had to work on.
Man-made horrors that, sadly, are no longer beyond my comprehension.
Every single one was a tangled mess, each in its own bizarre way. Detestable? Yes. Testable? No.
All vanilla pre-7 PHP, no frameworks, no libraries. At least I get to bump them to 8.1 but that's about it.
The language gets a lot of stuff right and there is certainly a case to be made for it. The inconsistent stdlib is annoying but it's not a deal-breaker.
Like PHP, AWK is an otherwise terrible language taylor-made for a specific use-case and it's awesome because of it.
Luckily, my job involves other things beside legacy PHP and I would never accept or stay at a job that doesn't.
Frameworks are massively overrated.
The problem with old PHP code isn't the lack of frameworks, it's that the kind of people who used php were rarely good programmers.
>Perl looks like an unreadable mess
for you >while PHP is pretty easy to read.
wait untill you see the 100 array functions and sort functions of PHP
enjoy writing as many functions as in C because PHP can't into expressions
I know, PHP does give off strong C vibes, and many parts of it are inconsistent. But I'm just talking about the basic syntax and the names of standard functions. Perl feels close to bash, with a bunch of cryptic abbreviations and meme symbols, while PHP feels more verbose and closer to a C syntax, which I'm already familiar with.
>and many parts of it are inconsistent
yes exactly, it's hard to find a more inconsistent language and it's a big reason why I can't fathom it >Perl feels close to bash
it is very far from bash tbh, by a lot >meme symbols
well, it does have lots of $, @ and % but they are not hard to understand >PHP feels closer to a C syntax, which I'm already familiar with.
perl's control flow syntax is closer to C than virtually all scripting languages though (as compared to python, ruby, JS, lua, etc..), and concerning data structures it's closer to than the other scripting languages by a freaking mile, because of the semantics of references
Error checking is all over the place, combining sequential and associative arrays was a mistake, traits are half-assed, Unicode is half-assed, some functions aren't functions, strong metaprogramming requires eval, Laravel is too sloppy, autoloading only works with classes, I could go on. I don't quite hate it but the language is rotten.
I don't it's a perfectly useful language. It's a little ugly but that's about it. I tend to not use it much in my career anymore because it's harder to hire for
I don't. It's THE best language to quickly get something half decent out there. If you put in 10% effort it can even be decent. It's just that simple.
At best it's no simpler than any other lang. This argument was compelling when the alternatives were Perl or Java.
>node ecosystem
>for a backend
>blazor is exotic
...you're probably not a very good programmer
I don't hate it but it's rather hard for it to be competitive with the node ecosystem or than even some rather exotic solutions like Blazor.
t. former PHP dev of 8 years
it's just a bad language
90% chance you've seen one indian php tutorial or a bunch of redditors parrot old crap.
Either that or he's posting right from 2004.
Been programming since the 80s and have used PHP since 2000 (first project an educational tool to help music theory students understand the 12-tone system). I still program with it today although only legacy projects.
PHP is bad. Bad language, bad ecosystem. I even find Perl preferable to PHP.
I don't blame people for using it. Use whatever gets the job done and there's a lot of support for generic backend webshit. Just don't pretend it's good.
Not that either.
So what if PHP has improved? So has every other language and they didn't start out so far behind.
>PHP is bad. Bad language, bad ecosystem. I even find Perl preferable to PHP..
>it is ... le bad
Ok, but nobody asked for your life story.
>bad ecosystem
Bait or mental illness
Ecosystem is ok for web stuff but once you step outside of that, so if you want to add something less typical you often find that the only good libraries for doing it are all in other languages, so you end with microservices even if you don't want that.
>coding in PHP ends in microservice
most PHP codebases end up as monoliths though?
I like PHP
I wish it had some features from other languages like "everything is an object" so you can do "foo".upper() and stuff.
strtoupper($foo);
Really odd thing to wish for.
Are you sure you like PHP?
I suppose the benefit is chaining so you can do:
var matches=foo.upper().match(/([A-Z]+) ([0-9])/);
instead of preg_match("/blah/",strtoupper($foo),$matches);
It "flows" better. But this is maybe one of those situations where perhaps you really shouldn't do either one.
Exactly, it just looks nicer.
You can do the same stuff in PHP and other languages, but sometimes they are just better looking.
You can kinda do this with the illuminate support package (included with Laravel by default), allowing you to chain string methods. str($string)->upper()
What I want to know is why did we abandon mod_* integration into apache? mod_perl was how you got high performance dynamic scripting back in the early days, mod_php copied its homework to take over the entire internet, but if you want to use python or node you're expected to abandon the entire workflow and ramshackle cgi, fpm or worse, use the bundled web server instead of apache...
people don't want to be chained to apache
Implying there aren't options.
You're replying to a post about why we moved away from Apache mods as integrations with PHP. There are no real direct alternatives to that, and people wanting to be able to use alternative web hosts was the reason we stopped doing it.
Didn't imply that
>he thinks he needs a web server with node
new here?
Because the future (which already arrived more than 5 years ago, only you stopped in time) is serverless.
You won't have a server and you'll be happy.
There is a bult-in server inside PHP interpreter. Just saying.
>Because the future (which already arrived more than 5 years ago, only you stopped in time) is serverless.
You're late https://github.com/vercel-community/php
Honestly I don't hate the language. But when I walk into some business and inherit a shitty code base, there's a very strong likelyhood that PHP == some guy in India with extremely poor coding skills built this app and now it's my problem.
I don't tend to run into this with other platforms. PHP tends to have a lot of issues with people that did a Durgasoft course five years ago and now write most of its new codebases.
PHP is very progressive - https://www.php.net/manual/en/class.gender.php
My gender? My gender is int 8 or french, I'm a homosexual you see.
I'm a transnagger, where is my representation?
I have no idea why PHP gets the hate it does when LETS DO IT ALL WITH JAVASCRIPT exists.
Maybe people dont like PHP because they are bad programmers? I know that sounds like seethe but JS is far better at being shitty than php.
Modern PHP is fine.
Old PHP is cancerous and most hate is from grandfathered projects people had to deal with.
>and most hate is from grandfathered projects people had to deal with.
Zoomers unironically make memes making fun of PHP without having tried it.
Yes, and millenials hate COBOL, it's a historical trend.
You guys probably think a grandfathered project is something 5 years old.
I have clients fretting that support for php 7.4 is dropped already and they aren't ready to updoot to 8. In contrast, Python hasn't released a major version since 2008. R still supports v3. Clojure has been version 1 since 2009 and is still on version 1.
PHP gets hate in this thread because that's the topic. Typical PHP dev filtered by basic stats anysis.
>I have no idea why PHP gets the hate it does when LETS DO IT ALL WITH JAVASCRIPT exists.
This. PHP is much simpler and looks much nicer than muh JS async hell, yet people say they hate one and love the other.
Idk JS is pretty bad.
Weakly typed languages are brain damaged. All of them.
Modern PHP is not much different from Python or Ruby. Still a solid choice for web apps, but hey, we don't need web apps anymore.
I don't. It is super comfy. I actually like using it for simple scripts as much or more than Python.
cuz
Trannies use it
>Why do you hate PHP so much?
Because WordPress
Php has worse performance than Javascript with developer experience and safety of c. No idea why you'd go for it after 2015 or so.
that's bullshit, all IO operations are faster in PHP because you invoke native extension written in C directly. so first, V8 was designed to be used as a browser runtime. every operation has to get through this browser crust/sandbox/validation before it invokes a native function. second, when designing something to be used as a client application, you're going make heavier use of RAM and caching. you want the complete opposite on the server, smaller RAM footprint being better becuase you are serving more than one user. an idle nodejs process takes about 25MB RAM while a PHP process takes 2MB. that's why the event loop becomes a complete meme because you can just start 10 times as many PHP processes for every node process.
If you're running outside of a browser then you aren't using the browser sandbox. But regardless any fixed overhead for IO is going to be dwarfed by the time spend waiting for the actual IO to be performed.
> an idle nodejs process takes about 25MB RAM
You can serve as many requests as you would like from a single process in node. With PHP you tend to end up with one process or thread per connection (although granted there are ways around with this).
>You can serve as many requests as you would like from a single process in node.
you can't seriously believe that you can run a website with millions of request with one server and one node process. you will have to do multiprocessing with cluster, child_process or worker_threads the same way how you would do it with PHP. except the PHP processes are scheduled by the OS which makes it perform better on multi-core CPUs.
>Just use go
i agree, but those CPU intensive benchmarks are misleading because that's not a realistic use case for a server application. a DB select of 5MB and a json serialization of that data will be faster in PHP because that's just two invocations to C libraries. google results are completely worthless with SEO spam, so i can't find that benchmark unfortunately.
>you can't seriously believe that you can run a website with millions of request with one server and one node process
Yes, easily
>Duuuuude, just write your entire application in this exact mental gymnastics way or else literally anything you do blocks your entire single-threaded server
Node is naggerlicious.
No, it's exactly the opposite of that. The entire node runtime is non blocking by default so you don't have the problem you get in Python where you can kill your application by mixing blocking and non blocking.
It does look not quite as bad in web. Tech empower has, after meme js and php, standard php at 10% faster than standard nodejs.
Laravel bloat less than half performance of express or koa shit.
In computation benchmark game php gets shat on even by javascript.
Just use go, java or aspnet. Much better performance, better dev experience, more libraries. Java the worst of the bunch and still usable compared to php.
Techempower benchmarks are almost completely worthless.
Pretty bad ye but still the only one we have. A lot of it has nothing like real code.
>they have static string as current time and send that every time.
Java is typed so it is automatically superior to php dynamic meme soup
Because it's boomer tier garbage and everything PHP related is about maintaining shitty codebase from 2006 or, even worse, Laravel.
I don't hate PHP. However, I very much hate the PHP projects I've had to work on.
Man-made horrors that, sadly, are no longer beyond my comprehension.
Every single one was a tangled mess, each in its own bizarre way. Detestable? Yes. Testable? No.
All vanilla pre-7 PHP, no frameworks, no libraries. At least I get to bump them to 8.1 but that's about it.
The language gets a lot of stuff right and there is certainly a case to be made for it. The inconsistent stdlib is annoying but it's not a deal-breaker.
Like PHP, AWK is an otherwise terrible language taylor-made for a specific use-case and it's awesome because of it.
Luckily, my job involves other things beside legacy PHP and I would never accept or stay at a job that doesn't.
Frameworks are massively overrated.
The problem with old PHP code isn't the lack of frameworks, it's that the kind of people who used php were rarely good programmers.
I agree completely, should have worded it differently.
I learned perl first and PHP seems ridiculous to me
https://web.archive.org/web/20130625070202/http://www.theperlreview.com/articles/php.html
Weird, I'm not extremely experienced in PHP, but Perl looks like an unreadable mess to me while PHP is pretty easy to read.
>Perl looks like an unreadable mess
for you
>while PHP is pretty easy to read.
wait untill you see the 100 array functions and sort functions of PHP
enjoy writing as many functions as in C because PHP can't into expressions
I know, PHP does give off strong C vibes, and many parts of it are inconsistent. But I'm just talking about the basic syntax and the names of standard functions. Perl feels close to bash, with a bunch of cryptic abbreviations and meme symbols, while PHP feels more verbose and closer to a C syntax, which I'm already familiar with.
>and many parts of it are inconsistent
yes exactly, it's hard to find a more inconsistent language and it's a big reason why I can't fathom it
>Perl feels close to bash
it is very far from bash tbh, by a lot
>meme symbols
well, it does have lots of $, @ and % but they are not hard to understand
>PHP feels closer to a C syntax, which I'm already familiar with.
perl's control flow syntax is closer to C than virtually all scripting languages though (as compared to python, ruby, JS, lua, etc..), and concerning data structures it's closer to than the other scripting languages by a freaking mile, because of the semantics of references
>and concerning data structures it's closer to
C
Error checking is all over the place, combining sequential and associative arrays was a mistake, traits are half-assed, Unicode is half-assed, some functions aren't functions, strong metaprogramming requires eval, Laravel is too sloppy, autoloading only works with classes, I could go on. I don't quite hate it but the language is rotten.
because i hate webdev, next question
It sucks
I don't, I love Laravel so much. Laravel + Vue best web stack by far.
i broke up with my bf because he enjoyed using php, its a sign of mental sickness
I don't it's a perfectly useful language. It's a little ugly but that's about it. I tend to not use it much in my career anymore because it's harder to hire for
But I like PHP.
PHP is fine.