TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PHP is the new JavaScript?

84 pointsby davekiss8 months ago

30 comments

dubcanada8 months ago
I find it funny the author choose Symfony as a framework to &quot;shudder&quot; 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.
评论 #41469643 未加载
评论 #41469604 未加载
jf8 months ago
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()) { &#x2F;* javascript *&#x2F; } else { &#x2F;* PHP *&#x2F; } </code></pre> <a href="https:&#x2F;&#x2F;github.com&#x2F;tantek&#x2F;cassis">https:&#x2F;&#x2F;github.com&#x2F;tantek&#x2F;cassis</a>
评论 #41469655 未加载
评论 #41469610 未加载
评论 #41469672 未加载
评论 #41469881 未加载
评论 #41469786 未加载
ljm8 months ago
I don&#x27;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&#x27;s name is this tripe upvoted on HN?
评论 #41470233 未加载
mintone8 months ago
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&#x27;s Forge[1]. A better CI&#x2F;CD process? Envoyer[2]. Want serverless? Not for me, but Fathom[3] use it to deal with &gt;100Ms of hits a day; there&#x27;s Vapor[4]. All three of those are Laravel developed and maintained solutions.<p>If I&#x27;m throwing something small together then sure, I&#x27;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&#x27;s the bigger question: if you&#x27;re building to meet a business use case, or well, to make money, then why wouldn&#x27;t you use the most complete scaffold possible? I&#x27;d say Laravel is that. If it&#x27;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:&#x2F;&#x2F;forge.laravel.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;forge.laravel.com&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;envoyer.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;envoyer.io&#x2F;</a> [3] <a href="https:&#x2F;&#x2F;usefathom.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;usefathom.com&#x2F;</a> [4] <a href="https:&#x2F;&#x2F;vapor.laravel.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vapor.laravel.com&#x2F;</a> [5] To prove I&#x27;m not a shill, this is from literally last night: <a href="https:&#x2F;&#x2F;github.com&#x2F;simonminton&#x2F;consensus-article">https:&#x2F;&#x2F;github.com&#x2F;simonminton&#x2F;consensus-article</a>
hu38 months ago
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:&#x2F;&#x2F;laravel-news.com&#x2F;laravel-raises-57-million-series-a" rel="nofollow">https:&#x2F;&#x2F;laravel-news.com&#x2F;laravel-raises-57-million-series-a</a>
calibas8 months ago
There&#x27;s been enormous improvements to PHP&#x27;s performance and to the language itself over the past couple decades. It&#x27;s something worthy of praise.<p>That being said, it&#x27;s not the &quot;new Javascript&quot;. Javascript isn&#x27;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.
CuriouslyC8 months ago
PHP definitely is not the new JavaScript, but for people who want a server side solution for content delivery that&#x27;s separated from the client, I&#x27;m sure it&#x27;s much better than the mess it was 10+ years ago. That&#x27;s still just a transition from meme level tech to valid option though.
vundercind8 months ago
Backwards. “Serverless” JavaScript is the new PHP. Minus the high performance.
评论 #41469696 未加载
conradfr8 months ago
I don&#x27;t really get the hype for Laravel over Symfony, or the joy of writing prompt instead of actually coding.
评论 #41470707 未加载
cellardweller8 months ago
If anything, PHP is the new Java with its AbstractSingletonBullshitFactories, or some just can&#x27;t resist the urge to write it that way.
roschdal8 months ago
Good old PHP is infinitively more easy to understand than React js soup.
评论 #41469947 未加载
andirk8 months ago
Laravel + Vue is a popular and straight forward framework pairing. With all the shade in these comments, there&#x27;s almost no suggestion for alternatives.
评论 #41469918 未加载
TOGoS8 months ago
&gt; 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&#x27;t dump 1000 pounds of gunk on top to make the easy things hard and there hard things dang near impossible, then you&#x27;re not a &quot;web artisan&quot;, I guess.<p>Laravel needs its own &#x27;fractal of bad design&#x27; 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&#x27;t support composite keys. In that way we were forced to bypass the whole thing regardless of my feelings about it.
评论 #41469813 未加载
评论 #41469963 未加载
评论 #41469637 未加载
评论 #41469646 未加载
pjmlp8 months ago
While I use PHP on my private site, I am in no hurry to use it beyond that.
tredre38 months ago
Bit worrying that the first code example given in the blog isn&#x27;t valid PHP.<p>Strings are concatenated with the . operator, not +.<p><a href="https:&#x2F;&#x2F;3v4l.org&#x2F;v9tFN" rel="nofollow">https:&#x2F;&#x2F;3v4l.org&#x2F;v9tFN</a><p>Or in older PHP versions it would output a number (because it would cast the strings to 0).
评论 #41469827 未加载
评论 #41470033 未加载
pavel_lishin8 months ago
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&#x27;s still garbage. Things being shipped with huge swaths of code just commented out, spaces &amp; 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&#x27;ve seen - granted, in a very limited exposure - tells me that <i>most</i> PHP developers still write garbage code. Weirdly, I&#x27;ve even seen examples at work where developers write perfectly cromulent Elixir and Javascript&#x2F;Typescript, but somehow revert back to the fecal firehose when it comes to writing PHP code.<p>I don&#x27;t care how good Symfony or Laravel is. I care about what happens when my employer hires someone who can&#x27;t write good code, and in my experience, the odds of that increase hugely when we talk about PHP.
评论 #41470087 未加载
oddevan8 months ago
To play on how every engineer is different, OP is excited about PHP because of a framework, while I&#x27;m having more fun than I&#x27;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&#x27;s. :D)<p>[1] <a href="https:&#x2F;&#x2F;www.php-fig.org&#x2F;psr&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.php-fig.org&#x2F;psr&#x2F;</a>
wkyleg8 months ago
What ever happened to Hack (<a href="https:&#x2F;&#x2F;hacklang.org" rel="nofollow">https:&#x2F;&#x2F;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
评论 #41470172 未加载
tengbretson8 months ago
Just use Next.js and <i>only</i> use server components. Bang! you&#x27;re basically using PHP but with a better type system.
layer88 months ago
From the title I wasn’t sure whether it means PHP is improving or is going south.
durbinn8 months ago
How is this better than rails?
评论 #41472837 未加载
bschmidt18 months ago
Always thought React (specifically JSX) made JavaScript &quot;the new PHP&quot; in that there is markup all mixed in with syntax that is so similar to old school PHP.<p>&quot;New school PHP&quot; 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>&quot;Laravel is the new Rails&quot;<p>and<p>&quot;New PHP is the old Python&#x2F;Ruby&quot;<p>The original dev use case for Wordpress where you can easily put up a basic CRUD app with user logins and roles&#x2F;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&#x2F;AS3 lost developers to iOS&#x2F;Android. Unlike Flash, PHP never really died - just kept hanging around.<p>It&#x27;s not a bad language, brings back fond memories at least. But there&#x27;s nothing about its performance or usability that stands out, and there&#x27;s no core platform need for it the way there was with Wordpress. JavaScript has the browser DOM and Node, Python has AI&#x2F;ML libraries and best practices that aren&#x27;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&#x27;s just no use case for PHP.
pkstn8 months ago
<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Betteridge%27s_law_of_headlines" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Betteridge%27s_law_of_headline...</a>
technojunkie8 months ago
PHP 8.x == TypeScript
评论 #41469793 未加载
Pesthuf8 months ago
JS has done the impossible: It made me kinda appreciate PHP. I still despise PHP for its many design (it wasn&#x27;t actually designed, it just happened) failures, but I&#x27;ve yet to see an application running on a single server with PHP, Apache and MariaDB run slower than &quot;modern&quot; 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 &quot;loadAll&quot; endpoint to be premature optimization.<p>...I envy TypeScript, though. I wish PHPDoc was more powerful... I just want ADTs.
评论 #41469745 未加载
评论 #41476529 未加载
xigoi8 months ago
Personally, I hate frameworks that generate thousands of lines of “scaffold” code with hundreds of dependencies.
game_the0ry8 months ago
I thought react was the new PHP.
评论 #41470027 未加载
VeejayRampay8 months ago
everytime I see PHP and python, it reminds that the best of the three main languages in the &quot;slow &#x2F; overly dynamic&quot; lane (Ruby) got the short end of the stick for some reason, it&#x27;s terrible
评论 #41469920 未加载
akagusu8 months ago
Money really changes people&#x27;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.
评论 #41469930 未加载
Diti8 months ago
Wait until that person learns about FrankenPHP! <a href="https:&#x2F;&#x2F;frankenphp.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;frankenphp.dev&#x2F;</a>
评论 #41470026 未加载