PHP in 2023
171–180 of 285 posts
Re: PHP in 2023
#172For 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
#173If 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…
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
#174It'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/
Am I missing other important parts ?
Re: PHP in 2023
#175Earlier 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
Can you give an example of the footguns you so fear?
Re: PHP in 2023
#176used 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.
Re: PHP in 2023
#177If 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…
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
#178I 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 :)
Re: PHP in 2023
#179Earlier 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.
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
#180Earlier 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.