Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

91–100 of 402 posts

Re: I still love PHP and JavaScript

#91
I would say PHP takes effort to make maintainable projects, and allowed some of the most heinous code I have ever seen in production. It was likely the years of spiral development that made it so problematic.. and pear finished the job.

The good parts were a small memory footprint, fast soap/xml parser, and stateless finite execution. Unlike the 200MiB+ "hello world!" async nodejs standard popular today... one can run small php cms/wiki sites on budget servers.

Re: I still love PHP and JavaScript

#92
post #81
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…

Not sure about "no surprises" - just saw this on Twitter yesterday: https://twitter.com/LupinityLabs/status/1554217944179249153

[deleted]

Re: I still love PHP and JavaScript

#94
post #85
post #61

Defining good software is hard. Every definition seems to miss something. Including the definition in this article. It misses that Good Software is cheap to maintain and can easily have features added. This goal is hard to meet and there are lots of ways to get there. You can get there with PHP and JavaScript but both languages allow developers to create a mess. Don't get me wrong all languages allow developers to cr…

Thanks for the thoughtful comment. I indeed haven't fully articulated what is driving me to write this piece (besides a desire to give PHP a bit of love as it is so harshly criticized for reasons I don't entirely understand). I find "problematic PHP" much easier to untangle than say, "problematic node.js" or "problematic python". Because PHP is often older codebases that have survived the test of time, this is actual…

I had a bit of a laugh as I read this. I realized that PHP is my go to language for very simple side projects. I have one that is left alive. It runs the scheduling of greeters for a group I'm part of. Every week we have two people stand at the door to greet new people and help them find their way in. We used to have a spreadsheet that managed it but I kept forgetting to update it and send it out. There were also some rules that made it tricky. Like you don't want people to repeat too often, you want spouses to be on the door together and a few other boring details that made the spreadsheet a chore.

One weekend I got sick of that and threw together a tiny website that automates the entire process. My tool of choice was PHP because it takes no effort to get started. TBH it was a great choice for such a simple tool. It's been running for five years and has easily paid off the time it took to build.

I guess I agree with you more than I realized.

Re: I still love PHP and JavaScript

#95
post #44
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…

> EDIT: why the downvotes? The anti-PHP cult is strong here on HN. List 5 benefits of React and watch your upvotes skyrocket.

React gets an equivalent amount of disdain as PHP. Like 60% negative, 40% positive. (lots of preferences for server-side templating, htmx, Vue, Svelte, and Phoenix LiveView)

Re: I still love PHP and JavaScript

#96

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

Everything you say is well and good, but the businesses with the legacy codebase (PHP or Javascript) are still trying to pay someone to work on their systems, and quite frankly, their money is the same shade of green.

Re: I still love PHP and JavaScript

#97
post #44
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…

> EDIT: why the downvotes? The anti-PHP cult is strong here on HN. List 5 benefits of React and watch your upvotes skyrocket.

I agree with you on the anti-PHP cult, but it's become fairly "cool" to criticize React now (and JavaScript stuff in general).

Re: I still love PHP and JavaScript

#98

PHP was my main language from 2000 to 2011. I liked PHP 4 very much. "Pass by value" was the default, so it accidentally introduced me to the Functional paradigm, even though it didn't have the memory management to allow for real functional programming. (It did not internally share memory between old and new versions of an object.) I dislike the direction that PHP has taken since the introduction of PHP 5. For the la…

I abuse the crap out of PHP "arrays" between mapping to JSON rather well and allowing you to really put some strange data, functions and objects into them you can really get some work done with data processing.

Re: I still love PHP and JavaScript

#99
post #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…

I think it's the fact there are no compile times (those runtime tools you are talking about are at your fingertips) that people historically have not worried as much about types in PHP and JS. In many cases it does just feel like verbose boilerplate rather than a useful tool. Type checking is just one of the many things you can test by hitting ctrl+R, and you will be doing that anyways to test everything else. (Obviously, the bigger the project, the less that is true, but that argument is well-known). Personally, I spend exponentially more time correcting my typos than my types, and auto-completion of previous used variables and functions is worth a lot more than a type system to me in my day to day.

I will never argue against types, but unless I am working with somebody else, I don't need them.

Re: I still love PHP and JavaScript

#100

I kinda like js but hate php with passion. Having said that php has one really very big thing going for it - people who use it are simply addicted to getting things done.

This! I use it as a mix of web applications and back end code, like you would with python. More and more my scripts I'm writing in PHP never see a web browser but the power of PHP Data processing has allowed me to really glue APIs together that have no official support in anything. I really do love it for being able to bash out a program in a afternoon and have it do amazing things.
Post reply on HN