Live data from Hacker News

PHP in 2023

stitcher.io

171–180 of 285 posts

Re: PHP in 2023

#171
The shade cast on Wordpress at the end is the article is a little disappointing. Ok, they’re behind on versions but for many years there was not much progress in PHP. Now PHP is flying and dependent projects are not keeping up. What can the PHP team do to help facilitate?

Re: PHP in 2023

#172
PHP runs a lot of my projects. Always grateful for the effort that goes into it. Deploying is very easy using git. Composer makes it easy to install libraries.

For the makers: with these packages you can easily make a nice blog/site with minimal amount of code and files.

https://phprouter.com (one file router!) https://github.com/EFTEC/BladeOne (Laravel Style Blade Templates, but much less files) https://parsedown.org (markdown library)

Re: PHP in 2023

#173
post #159

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 great if you just want to get something simple done as fast as possible with the simplest, most elegant (at a glance) code possible and don't care at all about understanding how it works, what's going on under the hood, performance, doing anything the devs didn't expect, etc. Everything in Laravel is as obscured, "magical" and opinionated as possible for the sake of making the code "beautiful" (again, at a…

Can you give me a few real life examples where you got bit by the "magic" conventions or ran into any serious issue from not explicitly setting properties on your models?

Facades are not global glorified variables with magic methods. Usually they're just a way to instantiate and access a class with less code. People complain that facades limit testability. In fact, they're easily mocked. Etc.

The docs do a very good job of explaining how things work and how you can override any "magic" you may not like. If something is doing something you didn't expect, you probably didn't read the docs. In fact, a delight of working with Laravel is it's so intuitive that you can often guess how to achieve something and be right.

Have you worked with Laravel in practice?

Re: PHP in 2023

#174

It's been 10 years since "PHP: a fractal of bad design" [1] was written. It's remarkable how the language evolved, and how many of the issues mentioned have been fixed and improved over the last ten years. 1. https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

I didn’t go back to all the points, but I get the feeling the configuration and security parts are mostly fixed, while the functions related issues and type looseness stayed mostly the same.

Am I missing other important parts ?

Re: PHP in 2023

#175

Earlier quoted context omitted.

You can quote yourself ad nauseam but that does not turn your incorrect statement into a correct statement. If you spent any amount of time looking at a modern PHP codebase, you'd discover that the type of code people write today is radically different to the type of code you'd have seen at the time A Fractal of Bad Design was written. There are still aspects of modern PHP that stand to be improved, absolutely, but t…

Your argument is basically: "Yes, yes, the footguns are still there front and center, but we added more guns that don't shoot you on the foot." If I was using PHP, I'd be livid that the cruft is never removed. Just deprecate and remove it

A lot of stuff is deprecated and not removed.

Can you give an example of the footguns you so fear?

Re: PHP in 2023

#176
post #3

used php in 2015, decided that it's not that nice. last couple of months, I've been banging my head with php7. granted, it's a legacy project, but it is still the same php 7-8 years ago.

PHP 7 is actually pretty good and was the version I stopped at. Upgrading to 8 shouldn't be all that bad and mostly you can just install the new version side by side with the old one. As with any interpreted language, you have to hit every page and what not in order to see if there are any issues that will arise. I don't know if at this point if PHP has a compiler as that would save a HUGE amount of time upgrading to new versions of the language.

Re: PHP in 2023

#177
post #159

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 great if you just want to get something simple done as fast as possible with the simplest, most elegant (at a glance) code possible and don't care at all about understanding how it works, what's going on under the hood, performance, doing anything the devs didn't expect, etc. Everything in Laravel is as obscured, "magical" and opinionated as possible for the sake of making the code "beautiful" (again, at a…

> And let's not forget the amazing "Facades" a.k.a. glorified global variables filled with magic methods that you're expected to make extensive use of.

Each of the facades comes with a corresponding dependency injection if you prefer. You can write an entire Laravel app without ever touching a facade.

Re: PHP in 2023

#178

I love PHP - although it probably only account for about 1/3 of my workload/project. Would love to see a loose-goosey-functional-lisp-like lang of php :)

Yeah now that you mention it I'm surprised there aren't more languages that compile to php. The runtime is actually pretty good.

Re: PHP in 2023

#179

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.

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.

It's funny how we both think of each others statement how strange it is.

For me, not being able to compare the two is like saying: You cannot compare a horse with a car as a means of transportation because a car is not an animal.

For me, I don't care one is a programming language and the other is a framework. For me they are both ways to generate HTML. PHP was/is mainly intended to generate HTML. It started as "Personal Home Page" and now is "Hypertext Preprocessor".

Re: PHP in 2023

#180
post #20

Earlier quoted context omitted.

If you're inherited a legacy project thats a mess then the chances are it was written by some ass who's not following the languages generally accepted PSR standards. Proper PHP code is extremely easy to dive into and maintain. The benefit and downside of the PSR standards is they are optional. Sadly some think they know better and opt to roll their own convoluted 'standards' that just end up creating hell for the nex…

PSR isn't generally accepted. It's a bunch of nobody know-it-alls that decided everyone needs to write java in PHP. No thank you.

You're just wrong. PSRs are widely accepted and all serious frameworks and PHP libraries implement them as needed. I haven't seen a PHP package in quite a long time that didn't implement PSR-4.
Post reply on HN