Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

271–280 of 402 posts

Re: I still love PHP and JavaScript

#271

I think that php has some weird disk usage behaviour that makes running Wordpress in a docker environment slow. I don’t know exactly what it is but I would say it is a weird behaviour of php anyway.

Wordpress is just bad. PHP is leader in CMSes but the old ones Wordpress, Drupal have to support so much legacy stuff. Including wierd patterns hand hacks from the past. Modern CMSes like Craft, Kirby, Twill, Bolt, October… it is very different story.

WordPress is great, they maintain backwards compat forever. Same reason I like PHP and can't stand working with NPM.

I'm sure the other CMS are fine but I want my site to auto update itself and all its plugins for the next 20 years with me hardly touching it.

Re: I still love PHP and JavaScript

#272
post #52

In 2022 there is no reason to prefer these dynamically typed languages over statically typed ones for production code. When languages like PHP, Ruby, JS blew up the knock against statically typed languages was the verbosity of the resulting code, slow development cycle and general cruft, these languages solved a real problem at that time. That is no longer true today- TypeScript, Go, C# code feels as fluid as a dynam…

Java got type inference? I need to see this!

Is it still really verbose with lots of too small classes?

Edit

https://www.javatpoint.com/java-8-type-inference

Wow that's pretty cool.

More? Less? Interesting is just how far I checked out of that language years ago.

Re: I still love PHP and JavaScript

#273
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 feel like PHP documentation is very undervalued PHP is documentation done right because of the comments, essentially "Stack Overflow" for PHP before stackoverflow.com was a thing. I've found an example of documentation done wrong recently with Microsoft .NET 6.0. Apparently, Microsoft has decided that code samples are no longer important

> PHP is documentation done right because of the comments, essentially "Stack Overflow" for PHP before stackoverflow.com was a thing.

It's funny really, for a programming language to rely on comments made by random people, instead of having those aspects covered in the documentation itself. Shows a bit of lack of care. It seems half-assed as many things in the ecosystem seem. What happens, if they ever lose that database of comments? The whole world scratches their heads wondering how to use standard library functions? Ridiculous. I hope they have good backups.

> I've found an example of documentation done wrong recently with Microsoft .NET 6.0. Apparently, Microsoft has decided that code samples are no longer important

And for as long as important documentation resides in comments in PHP docs, the same can happen to PHP docs. Lets say they push out PHP 9 and some things change. Someone thinks "Ah those comments are not actually true any longer. Lets get rid of them." Bam, massive resource lost, because the knowledge has not been integrated into the documentation.

Re: I still love PHP and JavaScript

#275
post #192
post #56

Earlier quoted context omitted.

This also results in easily breaking production.

On the other hand, if your production is already broken, it's much easier and quicker to apply a hotfix in PHP (just edit a file on the server directly) without waiting for the whole CI/CD to finish.

This leads in turn to testing/developing in prod. I do not personally miss it. If you have CI/CD you should not be able to skip it. Maybe putting it under a feature flag would be a safer alternative.

Re: I still love PHP and JavaScript

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

Have you tried a more "modern" language recently? By trying I mean using it for more than 6-10 months. I've been one of the PHP "supporters" until I've found Go and Rust. PHP was really nice to get into programming and make a spaghetti website but the language itself and the ecosystem always felt like a hacking project.

The killer feature of PHP has always been the hosting ecosystem. A simple FTP upload would do the job without knowing much about the hosting infrastructure. Recently we've got that kind of "serveless" experience for other languages as well but the deploying is proprietary and the providers are very few. I'm aware only of Google Cloud Run.

As for JavaScript even its inventor said it's time to move on. It's time for a new language and a new DOM interface. Maybe we can fix the "language" issue with WASM but we are still left with the DOM.

Re: I still love PHP and JavaScript

#277
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) That's sort of true, but the default state mechanism (session files) doesn't scale well, or even work across load balancers that don't maintain server affinity for each client. Scaling a PHP app isn't hard, but it can be non-trivial if you've written the code without considering scaling. Other serverside scripting languages (Python, Ruby with Rails) nudge you in the r…

It's trivial to configure PHP to store sessions in redis.

Re: I still love PHP and JavaScript

#278

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

What websites are you working on that have 10+ people? In my nearly 25 years working as a web developer, I don't think I've ever worked with more than three other developers at one time.

There's more than 10 developers working on Grafana (i work at grafana).

Re: I still love PHP and JavaScript

#279
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.”

I don't know for big instances of Laravel, for every deployment pipelines of Symphony I've seen were far from "Drop that file on the server. The end."

In the most primitive ways, you would at least do cache warming, which usually means "building" the app instance in a separate folder and swapping the active directory served by the web server. That's basically what a basic Capistrano deploy would do.

Nowadays I'd expect most shops to be using containers for PHP too, and that means building your container like any other language.

What I'm saying is, the days where PHP deployment was simple have been long gone, for at least a decade in my experience.

Re: I still love PHP and JavaScript

#280

Earlier quoted context omitted.

If there is no pre-existing test suite, it is extremely difficult to know what is the right expected behavior that should be tested, and what is incidental to the implementation.

Hopefully there is a product team or actual internal users you can interface with to know the expected behavior. I'd expect to at least be able to write some integration-style tests that can ensure everything works from the user's perspective. If you're so disconnected that you don't know the user's perspective or have no way to see the program in action, then ..best of luck!

Defining big obvious functionality is usually easy to get from people. It's all the finer details that people might not know. You might have a feature that's been relatively untouched for a while, but people still use, so the devs have either left or forgotten from their past "drive-by development".
Post reply on HN