PHP is the new JavaScript?
PHP is regaining popularity, primarily due to the Laravel framework, which enhances its development experience with structured features, shifting perceptions in the developer community towards its viability for modern applications.
Read original articleThe article discusses a resurgence of interest in PHP, particularly due to the Laravel framework, which has transformed the perception of PHP among developers. The author reflects on their own journey with PHP, noting its initial appeal due to its simplicity and accessibility, but also acknowledges the negative reputation it garnered over the years due to poor design practices. The introduction of Laravel in 2011 marked a significant turning point, offering a more structured and feature-rich environment for PHP development. The author shares their experience experimenting with Laravel, highlighting its ease of use and comprehensive features, such as built-in support for various functionalities like payment processing and authentication. This newfound appreciation for PHP and Laravel suggests a shift in the developer community, where PHP is being recognized as a viable option for modern web applications. The author concludes with a sense of excitement about PHP's potential, indicating that it may once again become a popular choice for developers.
- PHP is experiencing a resurgence in popularity, largely due to the Laravel framework.
- Laravel offers a structured environment with extensive built-in features, improving the development experience.
- The author reflects on their past experiences with PHP and acknowledges its previous shortcomings.
- The article suggests a shift in the developer community's perception of PHP as a viable option for modern applications.
- The author expresses newfound enthusiasm for PHP and its capabilities through Laravel.
Related
The demise of the mildly dynamic website (2022)
The evolution of websites from hand-crafted HTML to PHP enabled dynamic web apps with simple deployment. PHP's decline led to static site generators replacing mildly dynamic sites, shifting to JavaScript for features like comments.
When Objects Are Not Enough
Tony Messias examines Object-Oriented Programming's foundations, emphasizing actions in Laravel, historical context from Smalltalk, and critiques modern interpretations, advocating for a deeper understanding of OOP principles and experimentation.
I'm Back, Ruby on Rails
The author reassesses Ruby on Rails, praising its stability, built-in features, and supportive community, while highlighting its advantages for rapid development and deployment, making it suitable for startups.
PHP Is the Best Choice for Long‑Term Business
Tomas Votruba advocates for PHP as a stable, long-term business solution, highlighting its established frameworks, competitive innovation, and advanced tools that enhance code quality and adaptability for future changes.
Laravel raises a $57M Series A from Accel
Laravel raised $57 million in Series A funding led by Accel to expand its team and develop Laravel Cloud, maintaining its commitment to open-source principles and existing products.
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.
For example:
if (js()) {
/* javascript */
}
else {
/* PHP */
}
https://github.com/tantek/cassisThe 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?
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
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.
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.
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).
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.
(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)
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
"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.
...I envy TypeScript, though. I wish PHPDoc was more powerful... I just want ADTs.
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.
Related
The demise of the mildly dynamic website (2022)
The evolution of websites from hand-crafted HTML to PHP enabled dynamic web apps with simple deployment. PHP's decline led to static site generators replacing mildly dynamic sites, shifting to JavaScript for features like comments.
When Objects Are Not Enough
Tony Messias examines Object-Oriented Programming's foundations, emphasizing actions in Laravel, historical context from Smalltalk, and critiques modern interpretations, advocating for a deeper understanding of OOP principles and experimentation.
I'm Back, Ruby on Rails
The author reassesses Ruby on Rails, praising its stability, built-in features, and supportive community, while highlighting its advantages for rapid development and deployment, making it suitable for startups.
PHP Is the Best Choice for Long‑Term Business
Tomas Votruba advocates for PHP as a stable, long-term business solution, highlighting its established frameworks, competitive innovation, and advanced tools that enhance code quality and adaptability for future changes.
Laravel raises a $57M Series A from Accel
Laravel raised $57 million in Series A funding led by Accel to expand its team and develop Laravel Cloud, maintaining its commitment to open-source principles and existing products.