by davekiss on 9/6/24, 7:33 PM with 87 comments
by dubcanada on 9/6/24, 8:42 PM
The rest of the article seems to be more about AI code editing and MUX video players then PHP.
So I am not really sure what I am supposed to take from this post.
by jf on 9/6/24, 8:48 PM
For example:
if (js()) {
/* javascript */
}
else {
/* PHP */
}
https://github.com/tantek/cassisby ljm on 9/6/24, 8:55 PM
The content of the article is describing the concept of a full stack framework, as if Laravel is the novel solution to it.
How in god's name is this tripe upvoted on HN?
by mintone on 9/6/24, 9:36 PM
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.
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.
[1] https://forge.laravel.com/ [2] https://envoyer.io/ [3] https://usefathom.com/ [4] https://vapor.laravel.com/ [5] To prove I'm not a shill, this is from literally last night: https://github.com/simonminton/consensus-article
by hu3 on 9/6/24, 8:48 PM
by calibas on 9/6/24, 9:27 PM
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.
by CuriouslyC on 9/6/24, 8:46 PM
by vundercind on 9/6/24, 8:46 PM
by conradfr on 9/6/24, 8:56 PM
by cellardweller on 9/6/24, 11:55 PM
by roschdal on 9/6/24, 8:45 PM
by andirk on 9/6/24, 9:08 PM
by TOGoS on 9/6/24, 8:48 PM
Funny, because Laravel was one of the things driving me away 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.
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.
[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.
by pjmlp on 9/6/24, 8:44 PM
by tredre3 on 9/6/24, 9:19 PM
Strings are concatenated with the . operator, not +.
Or in older PHP versions it would output a number (because it would cast the strings to 0).
by pavel_lishin on 9/6/24, 9:26 PM
Awhile back, we wrote an MVP, a proof of concept, using Wordpress. I dug around some of the plugins and themes we used, and my god, 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 flat out broken.
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 most 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.
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.
by oddevan on 9/6/24, 9:16 PM
(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)
by wkyleg on 9/6/24, 10:12 PM
Why not take an approach more similar to TypeScript?
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
by tengbretson on 9/6/24, 9:23 PM
by layer8 on 9/6/24, 9:41 PM
by durbinn on 9/6/24, 10:34 PM
by bschmidt1 on 9/6/24, 9:53 PM
"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.
I would say:
"Laravel is the new Rails"
and
"New PHP is the old Python/Ruby"
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.
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.
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.
by pkstn on 9/6/24, 8:49 PM
by technojunkie on 9/6/24, 8:45 PM
by Pesthuf on 9/6/24, 9:04 PM
...I envy TypeScript, though. I wish PHPDoc was more powerful... I just want ADTs.
by xigoi on 9/7/24, 8:17 AM
by game_the0ry on 9/6/24, 9:05 PM
by VeejayRampay on 9/6/24, 9:00 PM
by akagusu on 9/6/24, 8:55 PM
For more than 1 decade Silicon Valley bros considered PHP a bad,irrelevant, legacy programming language.
Now, with a PHP framework receiving millions in funding, PHP is cool again.
by Diti on 9/6/24, 8:56 PM