Live data from Hacker News

An Internet of PHP

timotijhof.net

201–210 of 333 posts

Re: An Internet of PHP

#201

This is great, and I'm glad for the PHP developers out there. But if I go job hunting, it's not PHP skills that offer the highest earning potential. At least not that I've encountered. How much revenue generation occurs on PHP? I'll cede the argument about the e-commerce platforms and CRMs, but I'm just not convinced that PHP is where a budding developer should be focusing their efforts. You enter the business/corpor…

https://www.jetbrains.com/lp/devecosystem-2021/php/

Still seems to be most popular in France, doesn't appear to be dying off there... Interestingly it's gaining popularity. Curious why that would be.

Re: An Internet of PHP

#202

Earlier quoted context omitted.

> The ability to interleave code and HTML was also tacky and never taken seriously And yet people would take a bullet for React and the JSX templates.

JSX and PHP are actually seriously different. When you break out of PHP, you're just outputting text to standard output. When you're using JSX syntax, you're constructing Javascript objects that can be manipulated using standard javascript techniques. Anyone who believes they're comparable seriously doesn't understand the task that is before them.

My reading of this thread is that people are comparing JSX as a templating language to PHP as a templating language, splicing PHP into HTML like how we have { ... } in JSX. At the end of the day React lets you write a function that returns HTML just like a PHP file.

Re: An Internet of PHP

#203

Earlier quoted context omitted.

PHP was the Visual Basic 6 for web. People without proper training and theoretical knowledge just went and did stuff.

Empowered a generation to get stuff done.

And leaving a steaming pile of unmaintainable shite being them.

Re: An Internet of PHP

#204

Ironically enough, if people actually tried PHP, many would be amazed, especially at the quality frameworks. Productivity is very high in something like Laravel, and compared to JavaScript frameworks PHP frameworks are much more feature complete and well though out. I'm a big fan of trying out different stacks, and I think a lot of people would love Laravel if they tried it. Give it a shot using PHPStorm and Laravel…

As a PHP developer of 10+ years, large frameworks like Laravel and Symfony still bewilder me. I really have no idea why 99% of people would ever want to use them.

They add a layer of complexity over the top of PHP such that instead of learning how to write PHP, you need to learn how to write the framework.

Let's take an example right from Laravel's homepage:

     Authenticating users is as simple as adding an authentication middleware to your Laravel route definition:
     
     Route::get('/profile', ProfileController::class)  
         ->middleware('auth');
     
     Once the user is authenticated, you can access the authenticated user via the Auth facade:
     
     use Illuminate\Support\Facades\Auth;
     
     // Get the currently authenticated user...  
     $user = Auth::user();

As a developer, looking at that code tells me nothing. WTF is the "auth" middleware? Where is it configured? What's it doing?

Then we come to `Illuminate\Support\Facades\Auth` - another meaningless string with a seemingly arbitrary name. WTF is "Illuminate" and why is it in my code? Why do I need it to authenticate users?

So I have to go and learn all of this crap before I even begin to understand what the code is doing. And for every other thing I want to do with the framework I need to look up how to do it "the Laravel way".

Re: An Internet of PHP

#205
It looks like a report on quantity of instances (sites, frameworks, packaged setups) but doesn't go into other metrics like traffic load, users, PnL or other money-metrics. Say the top 100 websites were all to use PHP, that would be a very different story than none of the top 100 websites using PHP, but neither is reported. We have some "we are in the top 500" and "we have billions of page views", but not much else.

That said, how good or bad a language is might not be quantified or qualified to a point where all audiences are happy. How it's used vs how it's structured, where it's used vs. how much money it's making can all mean different things to different people. If you look at it from an academic (CS) perspective it might not matter how much money it makes if it lacks some scientific nuances. But the same works the other way around as well; it doesn't matter how cool COBOL, FORTRAN or lisp is if you can't run your massive eCommerce web app with it (there is a joke in here somewhere).

Re: An Internet of PHP

#206
PHP was not great in the early days, same goes for Javascript, but they made web we use today, I'm not going to use today's standard on yesterday's realities. Both have moved on and are much better off now.

Comparing to PHP, modern frontend is the true mess still though, there was never a simple to use SPA frontend in existence, they're all complicated, over-engineered and changing too fast to me, and now they are even adding what PHP was good at(SSR), frontend is the problem and getting even worse to me. The backend, be it PHP-laravel, Ruby-rails or python-django, even node-express are an already solved problem, the frontend framework folks adding SSR into frontend frameworks are simply insane to me.

NOTE I'm not against SSR, what I dislike is that they add SSR directly into an already over-complicated SPA framework, which will kill itself under its own weight soon.

Re: An Internet of PHP

#207

Ironically enough, if people actually tried PHP, many would be amazed, especially at the quality frameworks. Productivity is very high in something like Laravel, and compared to JavaScript frameworks PHP frameworks are much more feature complete and well though out. I'm a big fan of trying out different stacks, and I think a lot of people would love Laravel if they tried it. Give it a shot using PHPStorm and Laravel…

As a PHP developer of 10+ years, large frameworks like Laravel and Symfony still bewilder me. I really have no idea why 99% of people would ever want to use them. They add a layer of complexity over the top of PHP such that instead of learning how to write PHP, you need to learn how to write the framework. Let's take an example right from Laravel's homepage: Authenticating users is as simple as adding an authenticati…

> They add a layer of complexity over the top of PHP such that instead of learning how to write PHP, you need to learn how to write the framework.

To be fair, you could say this about many frameworks in many languages; Ruby on Rails is the first obvious example of this.

Re: An Internet of PHP

#208

I've always liked PHP. You wouldn't pick it for your job interview's coding test if you had a choice (Python all the way there), but it's so intertwined with the internet and what we've learned about programming over the years. First mover advantage kind of deal. And I've never had to deal with ESM/CJS/AMD whatever module nonsense with PHP. No transpiling anything, just edit and refresh. And so many useful functions…

PHP is akin to, I don't know, the Subway (fast food restaurant chain) of programming languages? You don't hear too much about it. You almost never notice it unless you're actually looking for it, unlike McDonald's with its ostentatious golden arches. It's popularity is waning. But it's still everywhere. [0] There are a hundred other sandwich chains that have tried to do it better but none have managed the ubiquity of…

With this analogy python would be the Ikea. You can go for the fast food (site scripting) or you can get really invested and build out your ML modules with it at scale ( remodeling a decking out your kitchen)

Re: An Internet of PHP

#209

Earlier quoted context omitted.

The mere concept of a "document root" is a problem though and a major footgun if you don't know what you're doing. Every other language acts as its own web server which wouldn't even be capable of serving files even if you tried; the only thing it does is respond to web routes defined by the application. This eliminates a whole chunk of security issues, from the one described above to malicious file uploads (PHP is p…

> The mere concept of a "document root" is a problem though and a major footgun if you don't know what you're doing. A non issue though after 2-3 days of working with this approach. All modern PHP frameworks have a so called front controller (an index.php file) that loads what it requires from ../ after, ideally, properly validating the request to avoid issues.

> A non issue though after 2-3 days of working with this approach.

Tell that to all the people with bleeding feet.

Re: An Internet of PHP

#210
post #71

Earlier quoted context omitted.

PHP has had a built-in web server since version 5. People use Apache or nginx because they want to, but because they need to.

The built in web server is awful on its own. Forget production usage, it’s hard to even use for a quick bit of E2E testing. Unfortunately it has some really opinionated routing rules with certain file extensions, preventing you from having a dynamic URL with something like a .json or a .xml extension. Instead it will always try to look up a static file of that and serve it instead. I can’t find the bug tracker issue…

You can take full control over the routing using router script, then none of the default rules will apply. To be honest, I really dislike how many applications are wired around some Apache configuration or at least assume some specific hostname or path to be used for no reason. If it works with the built-in webserver, then it will work just as well with pretty much any SAPI.
Post reply on HN