Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

31–40 of 402 posts

Re: I still love PHP and JavaScript

#33
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…

> - no "unknown unknowns". it's so tried-and-true, there's no surprises

This part is laughable. People who have been programming PHP for 20 years (several of them at my company) still routinely discover hidden bugs, quirks or general behavior that is totally unintuitive and nowhere found in the documentation.

Re: I still love PHP and JavaScript

#34
post #30
post #20

Earlier quoted context omitted.

>>I also don’t believe a bundled package manager is necessary — NPM isn’t bundled with JavaScript, and it seems to be doing ok. >I'm not sure what point you're trying to make here. If you install the Node runtime...And even if you are, why would some other runtime include NPM? Node nor any other package managers are included with JS. You seem to be emphasizing their point.

huh? Node is a JavaScript runtime. Its the "base thing". Its "JavaScript", at least in the sense that we are talking about here. So saying "Node isn't included", doesn't really make sense. When you install Node, you also get NPM, which is essentially what I said in the previous comment.

> When you install Node, you also get NPM, which is essentially what I said in the previous comment.

The other person said that JS also doesn't include a package manager. It sounds like you wanted to take issue with the colloquial use of NPM rather than their point about package managers not being included.

> I also don’t believe a bundled package manager is necessary — NPM isn’t bundled with JavaScript, and it seems to be doing ok.

Re: I still love PHP and JavaScript

#35
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…

Is Hack better than PHP?

Re: I still love PHP and JavaScript

#36

> 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…

Author here, thank you for reading the article and taking the time to comment.

Every legacy codebase I have worked with was actually a successful business. That probably plays a big role in why I enjoy working with them. The job is not easy, and in one case (800kLOC of PHP without a single function), I had to rewrite everything from scratch.

Legacy JS with its strata upon strata of framework du jour and jquery and porous language are indeed notoriously annoying. To be fair, I just isolate the legacy JS to its own little DOM sections, and then introduce a new framework in parallel until I can nuke the old code out.

Revamping a legacy JS codebase often comes with a design revamp as well, so it often becomes a matter of strangling [1] out the old API. I do really enjoy how typescript allows me to gradually introduce typing and leverage static analysis for more adventurous refactoring.

I use golang, rust and typescript as my daily drivers lately, but I must admit that my most horrendous legacy codebase experience was a tiny 20kLOC go program that was just a mess of concurrency nonsense. PHP codebases have a certain "flatten it out and don't be clever" style to them that make for easy strangling [1]. Highly abstracted codebases where the abstraction doesn't fit the use case anymore, or the abstraction was thoroughly eroded by generations of misinformed developers are much trickier.

What language I would use to greenfield a new application would depend highly on the experience of the team, but my usual approach is "whatever we are already using".

[1]: https://www.redhat.com/architect/pros-and-cons-strangler-arc....

Re: I still love PHP and JavaScript

#37

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.

Pixar should make a film called "Deployment Story" in which PHP is basically Woody (maybe it's even just the PHP stuffed elephant?), and Woody ends up in the box on the street, and then Woody's dev pal doesn't realize what they've really lost until some reflection is done. I'd watch that.

This reads better when reflection is used in both meanings.

Re: I still love PHP and JavaScript

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

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

Re: I still love PHP and JavaScript

#40

You can write good code without compile time type checking, but it requires so much more developer focus to avoid writing bugs than a language with type checking. Everything else, php’s “jankyness”, javascript’s mystifying truthyness tables, those are easily overcome problems. Handing a string to a function expecting a number, and not finding out about it until that code actually runs? That’s the real problem, imo

thanks for reading and commenting. I am incredibly bullish on static typing and static analysis in general. There are quite a few tools that bring these to PHP and JS (I am not entirely happy with PHPStan / Psalm, I am very pleased by Typescript). Before that, I have been using Jetbrains analysis tools.

In web development, I find that there is a certain freedom that comes with dynamic typing that I wouldn't tolerate in other systems software (my other specialization is embedded software), as easy templating and logging are givens.

The fact that so much in web can also be "caught" at runtime (monitoring, logging, tracing) changes the game quite a bit as well, giving dynamic typing a bit more breathing room.

Post reply on HN