I used to work way back in the day on PHP too, but even though I'm sure this will be downvoted, it's really sad people still take it seriously as a language in 2023. There's nothing remotely elegant about it. It's not expressive or programmatically succinct in the way Ruby is. It's not beautifully well thought-out the way Python is. It's not fast and modern in the way Rust is. It's not elegant or composable or client…
Compared to moat languages, if you have no visitors, php takes up 0 system resources from your system to just sit there and wait. So you could have hundreds of small sites on the same machine for an extremely low resource cost. That is something it brings to the table and its very beneficial for hosting solutions where there are a lot of small webaites sharing on the same resource.
PHP in 2023
261–270 of 285 posts
Re: PHP in 2023
#262Earlier quoted context omitted.
Php's inconsistencies in regards to needle vs haystack make me weep. Javascript doesn't have anything remotely like that.
I hope you realize that "fixing" these types of early mistakes is almost impossible for PHP, a language which tries hard not to break things, especially something that's going to be used everywhere. But if this is such a deal-breaker and your IDE is dumb as a stump and can't remind you nothing prevents you from wrapping the stdlib or using something like psl to do it for you.
Re: PHP in 2023
#263Earlier quoted context omitted.
WordPress would cease as well I think. There are dozens of alternatives better than WordPress, if upgrading it meant a complete tooling change I think many would take the opportunity to replatform to something else. The only thing WP really has over them is it's expansive plugin library, and buy in from clients. But it's not really up to devs. I don't think many devs believe it's the best system, but it is desired by…
> The only thing WP really has over them is it's expansive plugin librar The expansive plugin library that WP has is due to its ease of use, stability and the extent it goes to acommodate users, developers and businesses at the same time. Its no small factor, its no small feat.
Re: PHP in 2023
#264If you are thinking about building a web application, take a look at Laravel. I not a huge PHP user, but Laravel is always on the top of my list for building web applications. It's the greatest web framework to ever exists, even better than Rails IMHO. The ecosystem around Laravel is really incredible and unlike any other framework. They have libraries for every stage of a web application from taking payments all the…
Laravel is a decent web framework, that comes with batteries included and _often_ has sensible ways to override and avoid things if you don't want them. For example, you don't need to use the ORM at all and can just use their query builder (which is pretty good). It's there if you want it, but the framework works happily without it and doesn't get in your way in that regard. I inherited a Laravel codebase from a prev…
Re: PHP in 2023
#265Earlier quoted context omitted.
> React vs PHP is a decision you can make, because... the intention of both is to output HTML. Often PHP is used when no HTML rendering happens at all (Apis, scheduled jobs etc.) > I can use C within a Python project. Does that mean I can't compare the two? One is compiled while the other is interpreted, so maybe you can't compare those? Those are at least both programming languages. Several major python libraries ar…
> Often PHP is used when no HTML rendering happens at all (Apis, scheduled jobs etc.) When comparing to React those things are irrelevant. > the complaint was that PHP, a server side language, doesn't offer client side rendering built in. So am I allowed to compare server side rendering to client side rendering? Or are those 2 different things and I'm ignorant if I try to compare them?
Re: PHP in 2023
#266Earlier quoted context omitted.
we should show this comment to facebook that uses hack (php originated lang) in millions of files to run their little website and infrastructure. php isn't bad. just got a bad rep. many langs got quirks. some more than others. but php has more web production success story and usage than most.
You mean the slow, bloated website that rarely adds features useful for users?
Re: PHP in 2023
#267Earlier quoted context omitted.
we should show this comment to facebook that uses hack (php originated lang) in millions of files to run their little website and infrastructure. php isn't bad. just got a bad rep. many langs got quirks. some more than others. but php has more web production success story and usage than most.
> we should show this comment to facebook that uses hack (php originated lang) in millions of files to run their little website and infrastructure. Appeal to authority isn't a valid strategy. Facebook used PHP because they wanted to build something really quickly and afterwards it became too costly to switch, as it always does, so they built an entire engineering department to work around PHP issues. Your average PHP…
Re: PHP in 2023
#268Earlier quoted context omitted.
It also has API routes and Middleware. But yeah, Laravel includes more by default. With Next.js, you need to pick a few more tools to go along with your stack. E.g. Next.js, NextAuth, Prisma, SQL database. You end up in a similar place, it's just not all part of the same package. That may or may not be beneficial for your team.
And the advantage of Next is that you can leverage React components server side and client side, and share code between them. Laravel Livewire is pretty nice for basic interactivity, which is all many sites need, but React becomes useful as soon as you start needing app-like features. At that point, using Next, which is already plugged in to that ecosystem, is a very nice experience. Next is great for static sites, t…
Re: PHP in 2023
#269Earlier quoted context omitted.
> Often PHP is used when no HTML rendering happens at all (Apis, scheduled jobs etc.) When comparing to React those things are irrelevant. > the complaint was that PHP, a server side language, doesn't offer client side rendering built in. So am I allowed to compare server side rendering to client side rendering? Or are those 2 different things and I'm ignorant if I try to compare them?
If you complain your tesla doesn't float very well, then you might be a little ignorant of what cars are used for (and that you probably should have used a ferry.)
React can even be both on server and client using 1 codebase (see Next.js). But it seems the PHP police here on HN does not allow me to compare that solution to a solution in PHP.
Re: PHP in 2023
#270If you are thinking about building a web application, take a look at Laravel. I not a huge PHP user, but Laravel is always on the top of my list for building web applications. It's the greatest web framework to ever exists, even better than Rails IMHO. The ecosystem around Laravel is really incredible and unlike any other framework. They have libraries for every stage of a web application from taking payments all the…
- Laravel uses Inertia for Vue.js or React integration while Symfony has an integrated solution with Symfony UX
- Symfony has become more modular with Symfony Flex
- Symfony has put a lot of effort into improving "developer experience" in the Symfony DX initiative
- Symfony has brillant docs in many languages including a new open book by Fabien Potencier and other Symfony collaborators