Live data from Hacker News

PHP is the new JavaScript?

mux.com

21–30 of 88 posts

Re: PHP is the new JavaScript?

#23
post #9

Why choose between PHP and JavaScript when you can write code in CASSIS, a language that runs in the syntactical intersection of both languages? For example: if (js()) { /* javascript */ } else { /* PHP */ } https://github.com/tantek/cassis

As someone whose primary languages right now are PHP and JS...

...that looks incredibly cursed.

Re: PHP is the new JavaScript?

#24
post #8

> What happened? Well. Laravel happened (and has been happening). 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 gues…

Hearing these negative laravel opinions is super interesting. As someone who absolutely dreads working with php, I’ve always been curious about laravel cause people seem to love it so much.

All I can figure is that a lot of people, especially those willing to put up with PHP's warts in the first place, look at a giant crusty knot and can only be impressed with its size and seek to emulate its design. If, upon seeing the huge crusty knot, you puke in your mouth a little and say "are you sure you needed a knot at all" they briefly look at you funny before carrying on to make bigger and bigger knot composition frameworks to blather about on their blogs where they have a picture of their head in a little circle, because that was trendy among the so-called artisans for a time.

Re: PHP is the new JavaScript?

#26
post #8

> What happened? Well. Laravel happened (and has been happening). 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 gues…

Hearing these negative laravel opinions is super interesting. As someone who absolutely dreads working with php, I’ve always been curious about laravel cause people seem to love it so much.

Nothing to fear about it. It's just a scripting language. It has some bad history but not so much because of the language but how it was used. The same messes could have been (and were) created with VBscript (ASP) and Perl back in the day.

Re: PHP is the new JavaScript?

#27

Backwards. “Serverless” JavaScript is the new PHP. Minus the high performance.

I mean, in some ways JS truly is the new PHP. That is when you output some jsx template string, which conditionally has pseudo HTML elements (more components, but with HTML syntax) inside it, mixed with normal HTML tags, which in turn contain snippets of JS, which can have side effects ...

All of course preferred by the daily JS coder, instead of separating it out as one used to do with traditional template engines. PHP is the one that probably started this intermingling of everything, treating HTML as a mere string, instead of structured data, one of the biggest sins, leading to countless vulnerabilities over decades of web development. JS now carries on that torch of treating HTML wrong, only that the frameworks have apparently built in parsers or processing steps for their jsx, so that they find the web components and can separate them out from the surrounding HTML string, to evaluate them and output the HTML of those components into the surrounding HTML string.

JS also got the hallmarks of attracting a lot of beginners, just like PHP used to do, due to all the hype around JS frameworks. It is very tempting. You can quickly see the browser do something. With some backend language it will take much more, to see anything graphical. Seeing things move or change how something is displayed is a strong feedback and motivator for the beginner.

Re: PHP is the new JavaScript?

#28
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.

...I envy TypeScript, though. I wish PHPDoc was more powerful... I just want ADTs.

Re: PHP is the new JavaScript?

#30
post #9

Why choose between PHP and JavaScript when you can write code in CASSIS, a language that runs in the syntactical intersection of both languages? For example: if (js()) { /* javascript */ } else { /* PHP */ } https://github.com/tantek/cassis

That looks so... unholy ...

The Dunwich horror, but with languages.
Post reply on HN