Live data from Hacker News

PHP in 2023

stitcher.io

261–270 of 285 posts

Re: PHP in 2023

#261

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.

Along this line, I like how memory leaks just can't be a thing because the page only exists so long as it's being rendered.

Re: PHP in 2023

#262

Earlier 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.

I think you actually could fix this forward by using named arguments instead of positional ones?

Re: PHP in 2023

#263
post #212

Earlier 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.

I do agree, which is why I think WordPress would go away pretty quickly of they ever invalidate their legacy of plugins through a major change.

Re: PHP in 2023

#264
post #181

If 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…

What are your preferred alternatives to Laravel?

Re: PHP in 2023

#265
post #236

Earlier 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?

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.)

Re: PHP in 2023

#266
post #202

Earlier 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?

nope, i mean a website that serves billions

Re: PHP in 2023

#267
post #144

Earlier 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…

appealing to authority? lol. no. read my comment again. it shows real production example of a juge, complex, website that serves billions. average php devs can't do that? maybe. but the php lang doesn't block them.

Re: PHP in 2023

#268
post #150

Earlier 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…

Inertiajs is the right solution if you need more interactivity than livewire. It can be used with react or vuejs out of the box (probably svelte too but haven't looked it up).

Re: PHP in 2023

#269
post #265

Earlier 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 be used both on the server and client side. That is a benefit over something that can be only used on the server side.

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

#270

If 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 has many "admin libraries" (Voyager, Orchid, Filament, Twill, Backpack, ...), some of them open core, each with their own idiosyncrasies. Symfony has EasyAdmin.

- 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

Post reply on HN