Earlier quoted context omitted.
I'd be interested to know what you think PHP got wrong with respect to web development? The majority of the web is running on PHP to this day, so at least in terms of popularity it seems people don't feel this way generally. Furthermore, if one were philosophically-minded, it could be argued that PHP's "shared nothing/one thread per page" execution model is the very quintessence of HTTP.
I’m curious what metric you’re using to determine that a majority of the web is running on PHP.
PHP is worth learning and using
401–410 of 468 posts
Re: PHP is worth learning and using
#402Earlier quoted context omitted.
I’m curious what metric you’re using to determine that a majority of the web is running on PHP.
Surveys generally indicate that of sites where it is possible to determine the language, somewhere between 70% and 80% of them are running PHP. Of course, that figure will include a lot of WordPress sites.
Re: PHP is worth learning and using
#403Earlier quoted context omitted.
Sorry, I should have clarified "heavy" in terms of the level of OOP [1] insanity but yeah Symfony is very modular. [1] e.g. "Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator"
> in terms of the level of OOP [1] insanity I would have to question how relevant a piece of core plumbing is to a regular user of the framework, as a regular user of the framework would likely never come across this class. Also if you're working in the domain as a Symfony core developer, the idea of a ContainerConfigurator is not so insane, if you're developing a dependency injection container.
Re: PHP is worth learning and using
#404I really don't understand all the PHP dismissal on HN. As a language it has continued to evolve in meaningful ways, especially with the latest releases. Companies like Facebook are built on PHP (yes, they extended with Hack, but most of the benefits are available in PHP 8 now without the downsides). Coming from a C background, I found PHP easy to step into as many of of the underlying libraries and common functions a…
Re: PHP is worth learning and using
#405Earlier quoted context omitted.
This. While I'm not sure I'd build a website or something with R, for pretty much anything data related R is a first choice. Even for big data on clusters or something. It's absolutely amazing at what it does. Super easy Fortran and C++ interop. Bonus that it's well enough known in academia and fields like statistics or economics.
I'm not sure I'd build a website or something with R Have you played with Shiny (shiny.rstudio.com). If you're building a website for interactive data exploration and analysis, it is very hard to beat.
Re: PHP is worth learning and using
#406Earlier quoted context omitted.
Wikipedia too. And probably many WordPress websites with a lot of traffic. If anything, PHP has proven it works in this regard.
Facebook and Wikipedia were both founded ~20 years ago, think they would make that same decision today? PHP works, but imho starting a new company or career with PHP is a mistake.
Why would it be a mistake?
On the one hand I have a few examples of huge, successful projects written in PHP and I know they are still around 20 years later and haven't been rewritten in another language. I use projects in PHP on a daily basis (Nextcloud, Rainloop, Wordpress) that work well and have been maintained for years. On the other hand I have a few comments calling out PHP without convincing arguments. Something is wrong.
I practice Python and Javascript daily, I've written PHP code 10 years ago, still use some of my code. I occasionally update PHP code on a website I manage. I've seen good things in the new versions.
Should I begin a new project today, I would not rule out PHP that fast. I like Python and Typescript, but PHP projects are often a breeze to install (unzip, done) and survive system upgrades and reboots easily as long as php-fpm runs. Projects in other languages need more babysitting. I know, I also use web software in other languages, including one I author.
PHP is dead simple to write too.
I would probably go for nodejs for something that requires Websockets or SSEs (or a compiled language). Otherwise, I'd seriously consider PHP because it does not require setting up something like uwsgi or celery, write reverse proxy rules, write init service files or running Docker. Put the files in www and it's done. Also no code for managing routes, the file system organization does this for me. No memory leaks, everything is thrown at the end of each request. The architecture is robust.
Re: PHP is worth learning and using
#407Earlier quoted context omitted.
One thing I've noticed is people who code in PHP for work or projects don't bother to come on here and try and defend the language. It's underrepresented, but maybe the groupthink ship against PHP has sailed here a long time ago, they don't bother. Or perhaps, more likely, they are too busy creating.
While I primarily program in python these days I have two major open source PHP projects (millions of downloads each). I was also part of the standards group that tried to modernize some aspects of PHP (to various degrees of success). In general I would never bring them up on this site. It's just not worth my time or effort. I've even gone so far as to ask people who have posted my blog posts here to take them down.…
Aside from PHP, can you think of any other topics that can be problematic in this regard? So far i haven't personally run into any that would get me disproportionate amounts of negative votes, however i find myself curious about it. The only i could personally think of would be Perl and the discussions surrounding its history.
Perhaps i've just been lucky so far, or maybe you can tackle some of those topics by phrasing your points as questions or just pointing out that those are subjective views, instead of absolute truths, thus stimulating a discussion, rather a clash of opinions.
Personally, i think that sites like Habr or some Reddit communities could be more biased as far as discussions about topics go, due to the specialization present (e.g. a blockchain centric subreddit might not be receptive of criticism, even if constructive), however i've also heard similar things about Team Blind, whereas my HN experience has generally been fairly pleasant.
Re: PHP is worth learning and using
#408Earlier quoted context omitted.
My favorite thing about PHP is the execution model. Every single request is brand new and runs the whole program start to finish. IMO that's extremely powerful in its simplicity and while you can get it in other languages, it feels like like a "core competency" for PHP (just like how async code is easier in javascript than in python, because JS kind of had it from day 1)
Async code is a good way to achieve some level for performance in I/O bound workloads, but it's a pain for the programmer. Because of that I wouldn't say that it's necessarily a good thing that JS is async-first. In my opinion, high level languages should not expose async primitives to the programmer - this should be abstracted away by the language and its runtime. Go is doing this (all I/O is async under the hood),…
Re: PHP is worth learning and using
#409Earlier quoted context omitted.
I see this as the opposite and find it adds quite a load of complexity and prevent to do some form of optimization in an app that has its own server. It adds its load of complexity on how to run the apps itself, you need an external server, apps often requiring some customization of the server that will run it (either mod-php or php-fpm). It means that parts of our app settings lives outside of the app, it also make…
I don't find this to be true at all. > you need an external server Spoiler, you need an external server for everything on the web; you've just been brainwashed to think serverless is actually that.
Lots of languages and frameworks make it easy to be self-hosted with there own server. In Python, .net, Go, Rust this is quite common.
This means that your app can be a self-contained app + server and the server part can have some business logic as well.
With Go, .net, Rust apps (and potentially others) that's quite nice to be able to produce a single binary app that you can just run anywhere without installing any framework or setting up any external server and it's ready to listen to incoming queries.
That can even be a good enough setup for home things that are not exposed to the web and where setting up reverse proxies could be overkill.
Re: PHP is worth learning and using
#410Earlier quoted context omitted.
I see this as the opposite and find it adds quite a load of complexity and prevent to do some form of optimization in an app that has its own server. It adds its load of complexity on how to run the apps itself, you need an external server, apps often requiring some customization of the server that will run it (either mod-php or php-fpm). It means that parts of our app settings lives outside of the app, it also make…
PHP does have it's own built-in server as well, although it is not really meant for production use. Global PHP configuration options have become less important over time, with resource limits and extensions being most of what has to be configured now.
I only host one PHP app now (Nextcloud) and it has definitely been a bit of a pain in comparison with other things I self host.