Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

151–160 of 402 posts

Re: I still love PHP and JavaScript

#151
post #4

PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…

I really like the serverless aspect. I still think nothing has the deployment story that PHP applications have. Just upload some source and your website is up.

Interestingly, that has been the case for 25 years or so now but none except perl was able to do that?

Re: I still love PHP and JavaScript

#152

> I love legacy codebases. > A legacy codebase means that the product is performing well. It means that I can often make immediate and impactful improvements. Wow. This person must have worked on very different legacy codebases than me. Legacy Javascript code, to me, is something that I do not want to touch with a 10 foot pole, because every little piece of it can be intertwined with and used by many other hidden pla…

> never found a legacy JS codebase that has a robust test suite, so any refactoring I do can be hard to test and verify. Wouldn't you just... make a test suite?

> just

Legacy code bases are more often that not huge monstrosities. Maybe you do start with some tests and increment, but there's no "just" involved.

Re: I still love PHP and JavaScript

#153
post #4

PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…

I’ve always wondered why the more respectable dynamic languages, like Ruby and Python, don’t have a web framework with the PHP deployment model of “just upload this file to the server and refresh your browser to see changes.”

Python has had cgi forever: https://docs.python.org/3/library/cgi.html

Re: I still love PHP and JavaScript

#154

Earlier quoted context omitted.

That's a funny way of spelling job security

Hahaha I'm freelance (aka ronin) and so the job security is actually a bit spotty. :)

Ouch that is the worst. Called in to a great big mess. I hope by the time you get called in they realize they need to invest in some clean up time.

Re: I still love PHP and JavaScript

#155
post #4

PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…

> it's stateless by design (much easier to scale) I noticed being stateless made it difficult to scale for any complex app. It’s been 7-10 years since I used it but Drupal used 60-128MB+ plus per request. As it was stateless it had to do a full bootstrap for every request coming in, set up a new database connection, module discovery etc, all which was heavy to do for every request. Most people scaled Drupal by puttin…

> I noticed being stateless made it difficult to scale for any complex app. It’s been 7-10 years since I used it but Drupal used 60-128MB+ plus per request. As it was stateless it had to do a full bootstrap for every request coming in, set up a new database connection, module discovery etc, all which was heavy to do for every request.

It doesn't make scaling hard, it makes scaling very easy because you can just horizontally scale out as many instances as you need. The constant factor is pretty awful, but that's the tradeoff you make for statelessness.

Re: I still love PHP and JavaScript

#156
post #4

PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…

> it's stateless by design (much easier to scale) I noticed being stateless made it difficult to scale for any complex app. It’s been 7-10 years since I used it but Drupal used 60-128MB+ plus per request. As it was stateless it had to do a full bootstrap for every request coming in, set up a new database connection, module discovery etc, all which was heavy to do for every request. Most people scaled Drupal by puttin…

It might be much less efficient per request than other popular languages, but it's stateless design, does at least prevent developers from using local memory caches, which can prevent a number of problems from cropping up when scaling horizontally.

With that said, I think the stateless nature of php is talked up too much.

While not enforced by the nature of the language like php, writing stateless apps in other languages comes quite naturally.

Scaling difficulties are almost always to do with the database solution rather than the app, and overcoming those problems has little to do with the choice of language.

Re: I still love PHP and JavaScript

#158

Earlier quoted context omitted.

I really like the serverless aspect. I still think nothing has the deployment story that PHP applications have. Just upload some source and your website is up.

Do PHP applications really require no system packages for any use-cases?

PHP is pretty batteries-included, sometimes to a fault (it comes with things like 3 different MySQL drivers in the standard library). I'm sure there are cases where you'd want to install a C extension that depended on some system library, but I can't actually think of any right now.

Re: I still love PHP and JavaScript

#159

Earlier quoted context omitted.

i dont like react but even in react there is clear distinction, I've found tons of logic within templates of php like from .. anything at anytime could cause anything. Kinda gives me global variable vibes

That's an issue of design. You can't really blame the language for bad programming practices

You absolutely can and should. The language is responsible for the programming practices it promotes.

Re: I still love PHP and JavaScript

#160
post #123
post #47

Earlier quoted context omitted.

What cult? PHP is technically, objectively inferior to almost every other web technology (which is impressive, actually, given how terrible most web technology actually is) in almost every use case one can think of. That doesn't mean it's bad or that nobody should ever use it, or that it isn't a superior solution in some cases. But in basically any non-trivial use case, it's a poor choice.

Suppose you had a old car. You know its limitations, you've used it for many, many years. You know its problems, its quirks and warts. You also know the workarounds for its quirks. In all, it is good enough for most of your needs. It rarely surprises you. It is average looking, but it just runs and is easier to maintain. Then comes the shiny new car - it has way too many gadgets and gizmos, you don't know how most of…

PHP has never been simple or understandable though.
Post reply on HN