Live data from Hacker News

PHP in 2021

stitcher.io

221–230 of 309 posts

Re: PHP in 2021

#221

Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel. My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language/ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff…

Look at the abject failure of Discourse. If it had been written in PHP then it would have completely replaced all current forum software. But the devs there hate PHP and went for a modern stack which is all but impossible to install except for tech professionals. In other words, they chose a tech stack which suited them as developers, and not which suited the end users of the software. End users love PHP because you…

Exactly. I run a lot of services on a lot of servers for 10+ years now. Only the non-PHP projects (postal, zammad, otrs, elasticsearch, graylog from the top of my head) are hard to maintain and/or to install. And most of them need much, much more hardware to run, than any PHP software I installed. For example my zabbix installation with billions of records needs much less CPU and RAM than my zammad installation with a few thousand tickets. PHP is an ugly language and I refuse to work without a fine-tuned phpstorm installation. But on the server side PHP is just working fine under all conditions.

Re: PHP in 2021

#222
post #64

Earlier quoted context omitted.

> I would say that Laravel is an extremely high quality framework (on par with and even in some ways better than Rails) that nobody should be ashamed to use. Never heard of Laravel. Decided to take a look. First thing the intro documentation says to do is install something called 'Docker Desktop'. I'm good, thanks. Why do I need Docker to play around with a web framework?

> Why do I need Docker to play around with a web framework? PHP is server side, not frontend like React or Angular

I think OP was referring to Laravel as the web framework, not PHP.

Re: PHP in 2021

#223
I am not a programmer, and I have hired developers to build websites for me for close to 15 years now.

I love PHP. Two reasons. One, because this was the language I learned to code when I started off. So, it's easy for me to understand stuff my developers tell me.

More importantly, the language is so mainstream that the developers I work with are quite cheap to hire. The more sophisticated a language is, the fewer the programmers available for hire, which shoots up the costs with no visible changes to me on the front-end.

I'm currently building a simple search-engine like project - all on PHP. We have been testing it right now, and it's fast and usable - and I am not regretting my decision to use PHP for this; yet.

Re: PHP in 2021

#224

Earlier quoted context omitted.

I'd take a look at Nest.

Nest.js is more like Angular

I think you're thinking of Next/Nuxt. I'm a laravel dev but have tried every framework under the sun cause I get bored.

Next/Nuxt are basically react/vue SSR / Server Side Rendering or SPA frameworks... which seems more like Angular..no?

Nest.js is a fullstack backend framework more like fastify or express and has guides on connecting databases, graphql, etc....

Personally, if I were going to go with node, I'd choose nest.js or feathers or express as they have the best ecosystems ... but none seem as mature as laravel, rails, or django.

Re: PHP in 2021

#225
post #127
post #68

Earlier quoted context omitted.

That's because the "stink of old PHP" never really went away. For example, Wordpress install guide [0] still talks about making your code directory writtable by web user -- practically guaranteed that any minute exploit will lead to permanent web shell. So does Nextcloud install guide [1]. I am sure there are nice, modernPHP somewhere, but a lot of time you I see old-style programs with horrible security practices. […

WordPress is about as old as Netscape Navigator. Am I judging JavaScript based on the hot mess it was in these days? Using WordPress as an example for the state of PHP is disingenuous.

According to some statistics [0], Wordpress is used on 41% websites in the world. That’s a lot of websites! Even if those numbers are inflated, It is still likely the most popular PHP app in the world. It is not disingenuous to judge a language by its most popular application.

I wonder what fraction of PHP programmers today mostly work with Wordpress.. and how many PHP jobs involve maintaining Wordpress apps.

[0] https://w3techs.com/technologies/details/cm-wordpress

Re: PHP in 2021

#226

I know PHP is really great (and always has been). But sh*t, there is soooo much bad, no, really really bad PHP code that lives out there. Isn't it?

Yeah in my whole career, the worst codebases I’ve worked on are far and away PHP

HAve you never worked with jQuery / Javascript in tags and no real state management other than Local Storage or maybe some cookies? BEFORE webpack/etc so every plugin/package... is linked from the page you're working on?

PHP is bad, but my god some of the javascript nightmares and if you fuck up javascript with some recursion you can crash the entire browser.

Re: PHP in 2021

#227
post #147
post #43

Earlier quoted context omitted.

FWIW Bref is cool, but it's AWS-only and still has a couple of orders of magnitude fewer daily installations than Laravel: https://packagist.org/packages/bref/bref/stats vs https://packagist.org/packages/laravel/framework/stats .

Consider that many Laravel installs will be done on CI servers.

I guarantee that a larger % of the bref installs will be done on CI servers (bref is newer, and users of it are generally more advanced)

Re: PHP in 2021

#228
post #149

PHP has astounding longevity. In maintaining my personal websites (static pages, web toys, projects with my writing groups), I always ask myself: how will I keep this running in 20 years? It's unrealistic to think that languages will stay static over 20 years -- servers get rebuilt, old versions languages get deprecated, frameworks disappear. So the question becomes - will I know how to fix or rebuild this, even if I…

> It's unrealistic to think that languages will stay static over 20 years Depends on the language really. JavaScript? Yeah, good luck even spinning up a year old project on NodeJS without any breakages. Slightly better situation in the browser but most likely you'll need to change something if you're using NPM. On the other hand, Clojure hasn't had a breaking change in their core API in almost 14 years now, since you…

> Depends on the language really. JavaScript? Yeah, good luck even spinning up a year old project on NodeJS without any breakages. Slightly better situation in the browser but most likely you'll need to change something if you're using NPM.

Is that really true? I can't think of much in terms of older nodeJS stuff that would break on modern node (and with N, you can just install an older version of node).

Re: PHP in 2021

#229

Earlier quoted context omitted.

> with better development workflow What languages have better development workflow? I'm myself biased towards repl-driven development with Clojure, but for example Rust's or Go's development workflow is a lot worse than PHP. PHP: write file to disk, reload webpage/run curl Rust/Go: write file to disk, compile file, run binary, reload webpage/run curl The popularity of PHP is not hard to understand when it comes to ea…

>> Go's development workflow is a lot worse than PHP. I beg to differ. - Runtime errors are more common in PHP and that's a good enough reason for me to say that PHP dev workflow is worse. - You also seem to miss some common errors when the PHP assets are missing. Suddenly the compile con becomes an advantage for Go. - Different servers (apache, nginx, etc) give you yet another thing to configure. From my very old pa…

Me personally if I would be asked something like "we can;t use PHP starting from tomorrow for our backend crap, what should we use?"

I would say node or if we need to use a static language would be Java. And the choice is not about the language but about the entire ecosystem(libraries, tools, developers, documentation)

Using type hints and a good IDE there are not many type related issue slipping in the code.

Re: PHP in 2021

#230
post #216
post #188

Earlier quoted context omitted.

> is quick-to-learn, is OO to the bone, is FP where is fits with the OO, is easy to read, has little quirks. Exactly same applies to PHP - without FP part but in exchange one is getting enormous, gargantuan ecosystem of libraries, developers, hosting, language oriented and designed to rapidly deliver result and easiest deployments out there. Todays PHP is good, may be not trendy and hip right now, elitists may snark…

Full of quirks (there's a whole subreddit for that /r/lolphp), not OO to the bone (more like tagged on), hellish to read, no proper FP stuff. You may call people categorizing PHP as legacy "elitist", but big shops that use a lot of PHP are heavily investing in other tech (yes I look at FB). > it's good language to deliver products. Never said it was not. But it is not, anno 2021, a good language to start a new projec…

> It seems you have identified a lot with that language, and I see this often. Usually this happens to people who have little experience with other languages. The defend it like it is their home.

My take on this topic comes from extremely pragmatic and focused on results angle: delivering product. Not sure what about 2 sentences I wrote allows you to make broad assumptions about my experience, I don't feel need or desire do describe it here but it's not only my own opinion [0]

I think that Reddit "lolcontent" could be not good metric to use when deciding what should be used for building software.

[0] https://news.ycombinator.com/item?id=26830757

Post reply on HN