Live data from Hacker News

PHP in 2021

stitcher.io

211–220 of 309 posts

Re: PHP in 2021

#211

It is a great language to put food on the table. Especially in Europe it is still the dominant backend language. If you want to have flexibility on where you work it is a good language to know. You have the productivity of a scripting language but still great static analysis tools that help you out. It really fills a sweet spot that no other language does. Yes, Node has Typescript but then you have a super slow compi…

> PHP ... I think Haskell fills a good niche here. well, that escalated quickly

Fuck Haskell, that's kiddy stuff. Malboge or go home.

Re: PHP in 2021

#212

Earlier quoted context omitted.

> Also, I don't think Discourse can remotely be described as an abject failure, given that virtually every forum I've seen go up in the last five or six years runs on it Two thoughts and personal observations on that: 1. Nobody was ever fired for buying IBM. In my impression it's usually deployed as default for and esp. by very tech affine communities. It was the new, hot - and is now save - thing in town. 2. You see…

> how the Discourse forum is now powered by a new six core 8 GB RAM server improving performance ... for 200 concurrent active users and 80k posts. I guess companies that use Discourse and have huge traffic can pay a bit more, nothing wrong with that.

> I guess companies that use Discourse and have huge traffic can pay a bit more, nothing wrong with that.

The point being that said numbers aren't big traffic, they should be handled by a Raspi.

But for the sake of argument: Discourse is a painless move upwards for big budget and/or big knowledge entities. Nothing wrong with that.

On the other hand Discourse isn't a replacement for low cost, decentralized, easy to deploy, engine-diverse, low knowledge communities which were served by a multitude of PHP solutions in the past.

There's an economic argument for a growing divide between "communities as a service" ala Facebook and high hurdle deployments ala Discourse, but one doesn't have to be happy about this development.

Re: PHP in 2021

#213

PHP has been in a pretty good place since 7, IMO. These are some great developments. 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. It's unfortunate that the stink of old PHP is so powerful and that salaries are still lagging so far behind.

Laravel docs are virtually non existent. The code comments are meh. Their upgrades are frequent but are not backwards compatible. Many times after an upgrade we spent hours finding something that broke and was not documented in the upgrade guide. Their code quality leaves much to be desired, and it very significantly will slow down every part of the site. It is hard to call this a "extremely high quality framework" o…

Upgrading literally takes 1-2 hours MAX for any codebase and I've upgrading from MANY versions... I once updated a 4.2 app to 6.* ...that did take more than a few hours and there were some hitches but those would've been smoother if there was decent unit testing.

There's also some services that will basically use static analysis to tell you how to "safely" upgrade your project, what files need edited etc...

Re: PHP in 2021

#214

PHP has been in a pretty good place since 7, IMO. These are some great developments. 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. It's unfortunate that the stink of old PHP is so powerful and that salaries are still lagging so far behind.

Laravel docs are virtually non existent. The code comments are meh. Their upgrades are frequent but are not backwards compatible. Many times after an upgrade we spent hours finding something that broke and was not documented in the upgrade guide. Their code quality leaves much to be desired, and it very significantly will slow down every part of the site. It is hard to call this a "extremely high quality framework" o…

Also, can you kindly tell me how to upgrade from Rails 2.8 to 6.*?

I once scrapped a project trying to upgrade from 2.8 to 3.2..I see MANY open source rails apps that never upgrade because it's too damn hard they just keep building for an older version.

Re: PHP in 2021

#215

Earlier quoted context omitted.

Developers underestimate how difficult it can be to deploy server-side code for web apps or dynamic websites, particularly for less-technically minded users. As other posters have mentioned, PHP code can be as simple as uploading files to a folder on a server using a GUI FTP app. (And for some non-technical users, even that might be too complicated). By the way, Jeff Attwood (co-founder of Stack Overflow and one of t…

But almost no one writes php alone. Maybe hobbyists or Wordpress users. When we talk about actual applications that talk to a db - people use frameworks. Is deploying a Laravel app so much cheaper or different than a Rails app? Yes if all you need a wordpress website PHP is obviously the way to go. If you're an app developer PHP loses this edge quite quickly. Also I'm not sure an ftp setup is easier than Heroku.

> But almost no one writes php alone. Maybe hobbyists or Wordpress users.

What about that one guy who made https://remoteok.io/ using a single PHP file with no frameworks or libraries?

According to this live chart https://remoteok.io/open he made $88,000 last month from it alone with a 90%+ profit margin.

But more importantly it's a site that technically functions well and looks appealing. End users really don't care about which tech stack you used to build your site, they just want it to be fast, look nice and be easy to use which is achievable with pretty much any language or framework nowadays.

Re: PHP in 2021

#216
post #188
post #171

Earlier quoted context omitted.

> Ruby It has a very mature web dev ecosystem around Rails. It: is quick-to-learn, is OO to the bone, is FP where is fits with the OO, is easy to read, has little quirks. Personally I'd go with something with stronger types, no "null" and proper sum types. But if you are cool with dynamic typing: Ruby is a great choice. > Elixir Ruby-like syntax (some advantages just mentioned) and BEAM runtime. Yields very scalable…

> 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 project in. Not as bad as Perl and COBOL, but still legacy.

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.

Re: PHP in 2021

#217

PHP has been in a pretty good place since 7, IMO. These are some great developments. 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. It's unfortunate that the stink of old PHP is so powerful and that salaries are still lagging so far behind.

> I would say that Laravel is an extremely high quality framework I strongly disagree. My experience with Laravel made me see it as a medium quality framework with many flaws. I'll point out to a few of them. The source code quality of the framework is not very high, and locally very poor. For instance, you can't autocomplete normally with an IDE unless you load extra declarations of the magic. Sometimes functions re…

> framework is 10-100 times slower than others

Seriously?

This is the hill you want to die on?

With swoole (laravel octane) you can up localhost from 200 reqs/sec to 6000+ .. I've tested phoenix and only gotten about 4600.

But just going off "plain laravel"...

According to techempower it STILL beats rails and django.

https://www.techempower.com/benchmarks/#section=data-r20&hw=...

> Overall, the official documentation is tutorial-oriented, with an abuse of videos. I have not worked with Laravel for more than 2 years, but at that time I could not find a public reference documentation

The docs are geared more towards beginner/intermediate users most advanced users go to the API/class docs, and look at the underlying code to get an idea of how things work internally, if you haven't done that then you're definitely not going to know how everything ties together.

Also there's plenty of plugins and an ide_helper package to generate metadata/etc to make it so you get damn good autocompletion in just about any ide and especially phpstorm, but I use vscode and used to use sublime both have great completions...

Re: PHP in 2021

#218

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…

You have kind of answered you own question:

"people who just care about hacking something together and, as long as it works, it's fine."

If you need to hack something fast, deploy it using SCP on a cheap hosting then PHP is a very reasonable choice. The only thing which is needed is Apache PHP module enabled. No need to think about ports, starting some additional server, doing proxies, etc.

Registration form? In PHP you just need to open a file, add Obviously such application will have maintenance issues, etc. but very often this just does not matter.

Re: PHP in 2021

#219

Earlier quoted context omitted.

> I would say that Laravel is an extremely high quality framework I strongly disagree. My experience with Laravel made me see it as a medium quality framework with many flaws. I'll point out to a few of them. The source code quality of the framework is not very high, and locally very poor. For instance, you can't autocomplete normally with an IDE unless you load extra declarations of the magic. Sometimes functions re…

You say > medium quality framework with many flaws Yet you only point out > you can't autocomplete normally with an IDE > You won't see methods that you may call Firstly if there are "many flaws" list them because it seems you only don't like the developer experience with the autocomplete. I noticed no problem with browsing the Laravel API [0] with my short adventure with it. > framework is 10-100 times slower than o…

> Laravel is not the top pick for highly-concurrent idempotent microservice on Kubernetes,

Taylor Otwell would like to introduce you to Larvel Octane, i.e. support for swoole/workerman with 6k+ reqs per seq on a basic desktop.

Laravel with swoole basically makes it as performant as elixir/phoenix.

Re: PHP in 2021

#220

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…

We recently picked PHP for a large web application. The usual choices at our teams are Java11, Golang, and Typescript (+ a few teams that use Kotlin, C# and Rust). Many team members however also had experience with PHP in their career, but the main reason for us to pick PHP was Laravel's ecosystem really. The amount of features and scaffoldings that you get out of the box is just crazy. It gives you proper authentication for both web and APIs with 2FA and everything out of the box. Plus billing integration with recurring billing support and everything you need for payments, and also team management features ready in 5mins. And then you add another package for building administration panels (it's called Laravel Nova) which costs nothing comparing to alternatives for Java and deliveries much better development experience. It has been almost a year and no regrets so far.

I think it easily saves you 6 months of development time if you want to build a web app or a website beyond a static page. The ecosystem is very stable and reliable. So why not?

I encourage you to watch some of the introduction videos that they produce to show their ecosystem. That's how we were convinced to start investigating it. We spent a couple of weeks to make everyone productive with it. We had to catch up with all PHP7+ features and read Laravel docs. I think we will still build a lot with Java and Golang, but not for WEB. I don't see a better alternative for building web apps or front-end projects.

We don't however mention it in our portfolio or even on our job listing. It's apparently not cool for a publicly traded enterprise to say that we also use PHP.

Post reply on HN