Live data from Hacker News

PHP in 2023

stitcher.io

61–70 of 285 posts

Re: PHP in 2023

#61

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…

+1 for laravel as well. I joined a php project for a fresh rebuild in laravel and had mostly .net experience. Laravel was great.

The documentation is an almost perfect blend of examples and nitty gritty detail. The documentation is almost engaging if you’re coming from other frameworks.

I found myself thinking “wow that’s almost no code, what about this feature or that” and the next section would be the exact topic I was wondering about. Had a blast and could learn more php details as I went

Re: PHP in 2023

#62
post #45

Earlier quoted context omitted.

I’ve made a few “serious” projects with PHP and has been great, I never feel like I’m fighting against it to do what I need to do, the code can be very concise, its very fast and has a lot of batteries builtin. Python is not beautifully well thought out, the syntax is awful and the version conflicts make it a mess. You’re comparing to React which is not a language or in the same domain is confusing and makes me doubt…

> Your comparing to React which is not a language or in the same domain is confusing and makes me doubt your credibility. They both render HTML and do it in a very different way.

Yes, but that doesn't make it a programming language. A lot of things can render HTML. I am pretty fluent in Javascript, HTML, CSS, jQuery, React, Nodejs, Nextjs, PHP, Python, and a beginner in Java and a few others. React is not a programming language.

Re: PHP in 2023

#63
post #45

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…

I’ve made a few “serious” projects with PHP and has been great, I never feel like I’m fighting against it to do what I need to do, the code can be very concise, its very fast and has a lot of batteries builtin. Python is not beautifully well thought out, the syntax is awful and the version conflicts make it a mess. You’re comparing to React which is not a language or in the same domain is confusing and makes me doubt…

React isn't a language, it's an elegant pattern layered on top of (Java|Type)script which are languages. Not sure what versioning conflicts there are with Python but there are a lot of community solutions in the form of pyenv, virtualenv, etc. Python is well thought-out, imho, but I think it can take a certain type of person time to realize it. I used to hate it but the way I ultimately came around to understanding it was someone explained to me it's essentially extremely close to pseudo-code, which I think is ultimately why it can seem very natural and why so many universities and the larger STEM/ML community have all adopted it.

Re: PHP in 2023

#64
post #45

Earlier quoted context omitted.

I’ve made a few “serious” projects with PHP and has been great, I never feel like I’m fighting against it to do what I need to do, the code can be very concise, its very fast and has a lot of batteries builtin. Python is not beautifully well thought out, the syntax is awful and the version conflicts make it a mess. You’re comparing to React which is not a language or in the same domain is confusing and makes me doubt…

> Your comparing to React which is not a language or in the same domain is confusing and makes me doubt your credibility. They both render HTML and do it in a very different way.

That's such a strange statement, you can compare PHP and React because they both can return a HTML string? Even though one is built entirely within another language, and it isn't is not a "language". More of a toolkit. Same as say Symfony html framework is.

Re: PHP in 2023

#65

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…

I might be misinterpreting "taken seriously" with utility, but to me it is very valuable that a PHP script can just be dropped on almost any web server and it can start doing stuff, and that alone is reason enough not to not dismiss it.

I used to agree with this and think of it as a main benefit, but setting up a server to use Nodejs is easy and a lot of servers come prepped with node, npm, etc, so it's just as easy ad starting up a PHP project, if not easier because package.json can easily install dependencies.

Re: PHP in 2023

#66
post #60

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…

I agree with all of those points, except that it does have one thing going for it - it is easy for end-users to deploy PHP apps: FTP your files onto any random cheapo shared web-host, done. I’m amazed that it’s been so long and no other language comes close to that :(

Re-deploy, sure. Deploy? PHP packages still need installing, modules need enabling/configuring, PHP version needs to be chosen, etc. Unless it's a tiny project, the days of "just put the files on FTP" are almost gone.

Meanwhile for small, low traffic projects, serverless services are pretty close to the "just copy to deploy" model. And fly.io is all trivial for quite a few frameworks.

Re: PHP in 2023

#67
post #21

Earlier quoted context omitted.

As of PHP 5, it lost its way and started imitating the Java OO model with a worse botched-on syntax. PHP 4 used to be a compact "hypertext preprocessor" with many built-in groups of functions, enabling you to process forms, talk to databases or process images without much code.

How has PHP lost its way? It grew up from a poorly thought out hacky scripting language to a major programming language. All the nasty code you could write in PHP 4 or 5 is still possible, but everyone will look at your code and laugh.

Maybe because there are already major programming languages at that level already, which arguably do things better: if you are going to have a Java-like OO model, then just use Java (and leverage its ecosystem, tooling etc). Whereas there is a niche for a quick-and-dirty scripting language for just getting something up and running.

Re: PHP in 2023

#68
post #34

Why would a new project in 2023 choose PHP over anything else (modern Java, Kotlin, C#, etc.)?

Because people can make whatever decisions they want based on their own list of tradeoffs. I can tell you from experience laravel is far easier to get going than any c# or Java framework. You can SPRINT through a project in laravel and then break it into pieces after the fact.

I would pick it if I wanted to launch something new without getting stuck in premature optimization hell. Bigger org I probably would not unless I was building an isolated POC.

Re: PHP in 2023

#69

Earlier quoted context omitted.

> Your comparing to React which is not a language or in the same domain is confusing and makes me doubt your credibility. They both render HTML and do it in a very different way.

Yes, but that doesn't make it a programming language. A lot of things can render HTML. I am pretty fluent in Javascript, HTML, CSS, jQuery, React, Nodejs, Nextjs, PHP, Python, and a beginner in Java and a few others. React is not a programming language.

Right, that's why it was React.*script. Regex.

Re: PHP in 2023

#70

Hi, curious to try new version of PHP. Do you know some good tutorial to setup development environment?

Just hit up laravel and get building something quick and easy. I’m sure a lot of the laravel core contributors actually have some good advice for general env setup outside laravel as well.
Post reply on HN