Live data from Hacker News

PHP in 2021

stitcher.io

191–200 of 309 posts

Re: PHP in 2021

#191

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…

"My question is: why would anyone want to start something new with PHP in 2021?"

Because that is how people get things done.

Example. With Elixir/Phoenix/LiveView I will give you a simple task. Provision a phone number on Twilio. Please see this image:

https://imgur.com/a/iACVPvU

What would you end up doing? I would bet wasting a ton of time or hacking something up with curl. With PHP/python/ruby I would be done in 10 minutes.

Re: PHP in 2021

#192

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…

>For example, why would you write something in PHP when you've got an excellent choice between Ruby/Rails or Elixir/Phoenix/LiveView

You can make a simple website on PHP in ~30 lines of code (routing + boilerplate template) with nothing more than a text editor. It will have no dependencies beyond standard PHP modules, so you could then migrate this website to hundreds of cheap shared hosting providers just by copying files via FTP or SCP. It will run fast even on server with crap hardware. There is nothing remotely similar in any other language. All other solutions are less portable, require way more configuration and more infrastructure on the dev side.

...

~15 years ago I made a website for a certain community using PHP. I still maintain it. On my own time, on my own dime. It doesn't cost much, thanks to properties I described above. So it's still operational. Think about that next time you talk about "maintainability" and "stability".

...

I'd love to have the same ergonomics of deployment with other languages. You can make it work. Jetty + Apache Velocity, for example, can "feel" similar to PHP. But there are no hundreds of providers who will manage this for you with little to no configuration.

Re: PHP in 2021

#193

Earlier quoted context omitted.

As a front-end developer I can agree with that. Many times when I've wanted to install something for my needs, like forum engine or something similar, I was looking only for an PHP option. Why? Because it really is a copy-paste process with typing credentials to your database into dedicated file. No need to know any language/framework-specific commands, and no need to be overwhelmed by missing dependencies. And in hu…

Discourse is a pretty complicated piece of software (relatively). They do: mailing list, discussion forum, long-form chat room, This isn't gonna be some static blog, it's feature heavy. It needs redis, it needs some real-time chat capabilities etc etc. Also the choice to use a framework (Rails in this instance) was sound since it's complicated. So when comparing deployments you need to compare it to the php equivalen…

[deleted]

Re: PHP in 2021

#194

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…

laravel.com covers all features that are available and enable to know how to use the features, what documentation do you need on top of that?

We had no problems with upgrades yet, but the eco system is pretty big and there is a tool to make upgrades https://laravelshift.com. Pretty helpful.

I'm wasn't digging around in other web frameworks yet, so I'm not sure how to rate the source.

Re: PHP in 2021

#195

Earlier quoted context omitted.

End users love PHP because you copy the files into a folder. That's certainly how people deployed web apps built by other people a decade ago, but these days isn't it more common to use something like Docker? Deploying a containerized app should be pretty much the same no matter what language it's written in. And Discourse does have a Docker container ( https://github.com/discourse/discourse_docker ), so I'm not sure…

Non technical people won't use Docker, it's too complicated. Unless you make some environment as easy and widespread as your typical CPANEL shared hosting, you won't compete with PHP for that kind of end-user.

But isn't all cloud offerings basically a better cpanel with docker or kube or whatever?

Don't get me wrong, as a developer I hate the bloat, but as a UX/UI PoV you can install a lot of shit that's dockerized pretty easily...

sandstorm.io is a cool way to self-host open source projects for example

Re: PHP in 2021

#196
post #161
post #138

Earlier quoted context omitted.

Moving from PHP to ruby, language speed has never happened to be a subject. During coffee time banter, sure, but in real performance related issues, what we face came down to query optimizing, cache management, algorithmic issues and data pre-processing. We didn’t even hit the “let’s write this in C” moment nor debated about moving parts of the code to faster systems/libraries. I’m not saying it will never ever happe…

I'm sure that's the case. But as we break down the arguments that PHP sucks one by one, it's not performance, it's not libraries, it's not this, it's not that. How about this article "PHP a fractal of bad design", oh most of those no longer apply to PHP. What's left? The slightly unwieldy syntax (still C-like, so close enough), and the bad reputation driven by memes.

I didn’t touch PHP 7+ for kore than hobby projects so things might have changed, but to me PHP’s main issue (and to some extent JS) was the need for a strong defensive coding discipline.

There is no specific flaw that is a roadblock, just a ton of things you know you shouldn’t do, cases you need to guard against, and base functions we effectively banned from our codebase. I still like PHP, and just moved for unrelated reasons, but I think that’s a specificity of the language (as a side effect, good PHP devs also easily become good JS devs in my experience)

Re: PHP in 2021

#197

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…

Um... what?!

Laravel has extremely comprehensive documentation:

• General purpose docs: https://laravel.com/docs/8.x/

• API-specific docs: https://laravel.com/api/8.x/index.html

Laravel updates are released frequently (which is a good thing). Including 2 years of bug fixes, and 3 years of security fixes, for LTS releases:

• Major version upgrades are clearly documented: https://laravel.com/docs/8.x/upgrade

• Every new update has clear changelogs: https://github.com/laravel/framework/releases

• Backwards-incompatible releases are annual: https://laravel.com/docs/8.x/releases#support-policy

I would love you to point me to where Laravel's code quality leaves "much to be desired". The source code is, generally speaking, excellent.

Re: PHP in 2021

#198

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.

You "CAN" upload laravel to bluehost or any shared host and it will work, you may need to cut a few bits, or use external services for redis/sqs/etc if you want to use those things, or you could just use file/database for sessions/caching/etc.

I mean I started laravel on shared hosting, why did I use laravel for most of my career? Because the job I was hired for was to build a custom CRM for a book business, I was learning Rails so I spent 2 weeks on a rails prototype...

Boss gave me access to their hostgator account - shared hosting and told me to install it there. I stared blankly at them, um... okay.

Rails version I built in didn't match and I couldn't figure out for the life of me how to make it work...

Laravel 4.2 was almost a complete 1:1 match (in terms of directory structure) to rails and the language was just a bit different so porting what I had to laravel was a cinch and I had it done in 3 days and up on hostgator. No problems.

Also if you're like me and you freelance/consult, there's a TON more business in existing software/legacy than there is in new builds. Wordpress, Shopify, Laravel, Drupal, Magento, Salesforce are probably the FAANG of freelance platforms to learn to earn income from.

PHP is also generally faster than Ruby, and with Swoole it's sooo much faster (even than elixir/phoenix), so really why not use laravel/php. There's also tons of great packages out there and tutorials. The community is freaking HUGE.

Rails you even have to roll your own auth system or use devise which is a PITA. Laravel it's more opinionated but it's built for you including 2fa, social/oauth, etc..

Which isn't to say I wouldn't use fancier langs, I'm jumping at the bit to build some backend apis in rust or go for the hell of it, but only when I'm the decision maker as CEO/CTO on a side-project. For bread and butter I'll stick w/ what I know I can get paid for which is PHP/Laravel/Wordpress/Vue/Livewire/etc.

Re: PHP in 2021

#199

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…

> Is there anything that it does better than any other language/ecosystem?

It has the lowest barrier to entry, both as a developer, and a user - as far as I can tell no other language has even tried to compete in this area :(

Re: PHP in 2021

#200

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…

> Laravel docs are virtually non existent. The code comments are meh.

I consider the Laravel documentation to be incredibly helpful.

Post reply on HN