I find it funny the author choose Symfony as a framework to "shudder" about. Considering the base of Laravel is Symfony.<p>The rest of the article seems to be more about AI code editing and MUX video players then PHP.<p>So I am not really sure what I am supposed to take from this post.
Why choose between PHP and JavaScript when you can write code in CASSIS, a language that runs in the syntactical intersection of both languages?<p>For example:<p><pre><code> if (js()) {
/* javascript */
}
else {
/* PHP */
}
</code></pre>
<a href="https://github.com/tantek/cassis">https://github.com/tantek/cassis</a>
I don't understand this post; the author is just shilling Laravel; the entire post is an advert for Laravel with a clickbait title.<p>The content of the article is describing the concept of a full stack framework, as if Laravel is the novel solution to it.<p>How in god's name is this tripe upvoted on HN?
The comments on this thread are interesting. I use Laravel extensively. For big applications, serving lots of users. It works when the application is relatively complex, and the ecosystem is second to none. Need to just throw it up on a server? There's Forge[1]. A better CI/CD process? Envoyer[2]. Want serverless? Not for me, but Fathom[3] use it to deal with >100Ms of hits a day; there's Vapor[4]. All three of those are Laravel developed and maintained solutions.<p>If I'm throwing something small together then sure, I'll maybe use Flask or something lightweight[5]. But Laravel is very good for nearly every use-case where you intend to actually build something.<p>Then there's the bigger question: if you're building to meet a business use case, or well, to make money, then why wouldn't you use the most complete scaffold possible? I'd say Laravel is that. If it's too much of a pain to do something in PHP I can just stick in a call to a python file or really whatever language I want. But for the basics? A db? Auth? and lots of other stuff that I never want to personally build again? Yeah, give me Laravel everyday.<p>[1] <a href="https://forge.laravel.com/" rel="nofollow">https://forge.laravel.com/</a>
[2] <a href="https://envoyer.io/" rel="nofollow">https://envoyer.io/</a>
[3] <a href="https://usefathom.com/" rel="nofollow">https://usefathom.com/</a>
[4] <a href="https://vapor.laravel.com/" rel="nofollow">https://vapor.laravel.com/</a>
[5] To prove I'm not a shill, this is from literally last night: <a href="https://github.com/simonminton/consensus-article">https://github.com/simonminton/consensus-article</a>
Related: Laravel, the PHP framework mentioned by the article, just received a $57 million investment from Accel, the same folks that invested in Sentry and Vercel.<p><a href="https://laravel-news.com/laravel-raises-57-million-series-a" rel="nofollow">https://laravel-news.com/laravel-raises-57-million-series-a</a>
There's been enormous improvements to PHP's performance and to the language itself over the past couple decades. It's something worthy of praise.<p>That being said, it's not the "new Javascript". Javascript isn't dominant because of Node.js or anything like that, but because it runs in every major web browser. Whether you like it or not, Javascript is essentially part of the web itself.
PHP definitely is not the new JavaScript, but for people who want a server side solution for content delivery that's separated from the client, I'm sure it's much better than the mess it was 10+ years ago. That's still just a transition from meme level tech to valid option though.
Laravel + Vue is a popular and straight forward framework pairing. With all the shade in these comments, there's almost no suggestion for alternatives.
> What happened? Well. Laravel happened (and has been happening).<p>Funny, because Laravel was one of the things driving me <i>away</i> from PHP, in the same way that Rails drove me away from Ruby. PHP was becoming a salvageable language with some of the 7.0 changes, but if you don't dump 1000 pounds of gunk on top to make the easy things hard and there hard things dang near impossible, then you're not a "web artisan", I guess.<p>Laravel needs its own 'fractal of bad design' article. My experience was being told to use it for a work project by a koolaid-driven manager, and finding that it made our CRUD apps about 1000 times harder to write[1] and 100 times slower to execute. It seriously took Laravel 100 times longer (0.3s to 30s) just to bootstrap itself than it took our Phrebar app to handle a request including a bunch of database accesses and permission checks.<p>[1] Or maybe infinitely, even with code generation, because the ORM didn't support composite keys. In that way we were forced to bypass the whole thing regardless of my feelings about it.
Bit worrying that the first code example given in the blog isn't valid PHP.<p>Strings are concatenated with the . operator, not +.<p><a href="https://3v4l.org/v9tFN" rel="nofollow">https://3v4l.org/v9tFN</a><p>Or in older PHP versions it would output a number (because it would cast the strings to 0).
Forget the framework, forget the AI assistant. What are PHP developers like these days?<p>Awhile back, we wrote an MVP, a proof of concept, using Wordpress. I dug around some of the plugins and themes we used, and <i>my god</i>, it's still garbage. Things being shipped with huge swaths of code just commented out, spaces & tabs intermixed for indentation, TODOs littering the codebase. Things that were just <i>flat out broken</i>.<p>I used to be a PHP developer, and the habits that I learned probably stunted my professional career by a good decade. And from what I've seen - granted, in a very limited exposure - tells me that <i>most</i> PHP developers still write garbage code. Weirdly, I've even seen examples at work where developers write perfectly cromulent Elixir and Javascript/Typescript, but somehow revert back to the fecal firehose when it comes to writing PHP code.<p>I don't care how good Symfony or Laravel is. I care about what happens when my employer hires someone who can't write good code, and in my experience, the odds of that increase hugely when we talk about PHP.
To play on how every engineer is different, OP is excited about PHP because of a framework, while I'm having more fun than I've ever had explicitly _not_ using a framework!<p>(I am using the PSR standard interfaces[1], which means I can sub in any number of different libraries for different pieces of infrastructure. Including Laravel's. :D)<p>[1] <a href="https://www.php-fig.org/psr/" rel="nofollow">https://www.php-fig.org/psr/</a>
What ever happened to Hack (<a href="https://hacklang.org" rel="nofollow">https://hacklang.org</a>) the language Meta built as a superset of PHP?<p>Why not take an approach more similar to TypeScript?<p>I sometimes do wonder if many of the server side rendering approaches (or alternative Node runtimes) would be better off trying to emulate some aspects of PHP
Always thought React (specifically JSX) made JavaScript "the new PHP" in that there is markup all mixed in with syntax that is so similar to old school PHP.<p>"New school PHP" frameworks like Laravel are nearly exactly like Ruby-on-Rails: The same MVC style, database and ORM built-in, Laravel is so similar to Rails in many ways.<p>I would say:<p>"Laravel is the new Rails"<p>and<p>"New PHP is the old Python/Ruby"<p>The original dev use case for Wordpress where you can easily put up a basic CRUD app with user logins and roles/permissions was largely displaced by Django, which is just a little bit more mature of a project for such tasks than Wordpress could ever be. WP never wanted devs anyway, they wanted bloggers - so a lot of people stopped writing PHP simply because WP lost popularity as a web framework.<p>PHP lost a ton of up-and-coming developers to Python (esp. in academia) and JavaScript (esp. to Node), in the same way Flash/AS3 lost developers to iOS/Android. Unlike Flash, PHP never really died - just kept hanging around.<p>It's not a bad language, brings back fond memories at least. But there's nothing about its performance or usability that stands out, and there's no core platform need for it the way there was with Wordpress. JavaScript has the browser DOM and Node, Python has AI/ML libraries and best practices that aren't available in other languages, and in terms of another PHP use case - all the dynamic languages can quickly start an http server on localhost now. There's just no use case for PHP.
JS has done the impossible: It made me kinda appreciate PHP.
I still despise PHP for its many design (it wasn't actually designed, it just happened) failures, but I've yet to see an application running on a single server with PHP, Apache and MariaDB run slower than "modern" JS slop that needs half a cluster to run the dozens of random object DBs and caches JS devs insist on using prematurely where the application takes 20 seconds to load a simple page because the fully decoupled frontend needs to load and execute 500MB of JavaScript and that JavaScript then loads the data in 50 sequential XHRs because the API dev found a "loadAll" endpoint to be premature optimization.<p>...I envy TypeScript, though. I wish PHPDoc was more powerful... I just want ADTs.
everytime I see PHP and python, it reminds that the best of the three main languages in the "slow / overly dynamic" lane (Ruby) got the short end of the stick for some reason, it's terrible
Money really changes people's perception.<p>For more than 1 decade Silicon Valley bros considered PHP a bad,irrelevant, legacy programming language.<p>Now, with a PHP framework receiving millions in funding, PHP is cool again.
Wait until that person learns about FrankenPHP! <a href="https://frankenphp.dev/" rel="nofollow">https://frankenphp.dev/</a>