Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

321–330 of 402 posts

Re: I still love PHP and JavaScript

#321
post #81

Earlier quoted context omitted.

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

I did a 100-level paper at University that explained floating point arithmetic and how to solve for equality. Without being snarky, how do developers miss this sort of stuff?

Not every developer need floats for the backend of a website.

Re: I still love PHP and JavaScript

#322
post #181
post #149

Earlier quoted context omitted.

Python covers many of the same use cases and is much more consistent/predictable. TCL if you want to go back a bit further.

With Python one never knows when a particular feature code depends on will be removed. With PHP code written 15 years ago still works.

Which is a double edged sword. How many ways can one escape a string, and for how many of them will you find a stack overflow comment from a decade ago saying are the secure option to use?

Re: I still love PHP and JavaScript

#323

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

Over 10 people worked on the solution for utility meter readings in the Netherlands. All PhP, MYSQL and jQuery. Over 80% of the utility companies were served through this platform.

Re: I still love PHP and JavaScript

#324

I'm on a team that maintains two projects with over 500k PHP LOC apiece. They're built using a decent framework (Yii 1.x). One of them has a module that's about 25kLOC of AngularJS. They've each been running over a decade, and while there are some frustrations, it's not so bad. The biggest issue is lack of compatibility to migrate to later versions of the frameworks involved. They perform adequately for their purpose…

> They're built using a decent framework (Yii 1.x) Agreed - I've used Yii in the past and it was just great.

Just dont use the active record.

Re: I still love PHP and JavaScript

#325
post #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.

To which most developers say, oh well, because they'll never encounter them.

Re: I still love PHP and JavaScript

#326

Biggest flaw of php to me is getting paid well and the number of jobs. From the stack overflow dev survey, php devs get paid much less than others. Laravel and php is a beast, super easy to use. All that annoying shit is setup for you. But, how many ppl hire Laravel devs? Job boards are stacked with react, vue etc. Personal use is great though.

I'm a PHP dev, I didn't take part in StackOverflow survey and ~15 senior PHP devs that I know personally didn't take part either. Judging on such a small sample, I'd be guessing that it's safe to assume that survey is missing crucial data from people who do get paid well.

I'm 22 years in the business, 16 years working at the same place. At this point, there's various bonuses next to salary. After so many years, it's the domain knowledge and ability to figure problems out what gets me paid.

I don't have to work with the tool that someone tells me to use, I'm free to choose language/stack that I think is appropriate to solve the problem (deliver the project that's maintainable/useful for the customer).

I also don't take part in any surveys which makes the accuracy of the data questionable. There's plenty of people like me, what I learned is that a lot of senior/capable devs don't use social networks or sites like SO.

Approach the results of the survey very careful, false data is dangerous.

Re: I still love PHP and JavaScript

#327

Earlier quoted context omitted.

I’ve been using PHP since 2003 and it’s my full time job and this doesn’t ring true. Very, very rarely is a gotcha not in the docs comment section.

> in the docs comment section. A classic boiled frog statement. __It's not undocumented, someone posted a comment about that bug...__ I will quietly place my face in my hands and weep to the memory of php coding I did 20 years ago. Seems the same nonsensical masochism is still going strong.

This is a very common trope, someone who hasn't touched PHP in decades who still thinks they know anything about the language and ecosystem now.

Re: I still love PHP and JavaScript

#329

Earlier quoted context omitted.

Its so easy to just get things done in php, even if its in an ugly way that you would never show to another developer. I built a saas for a fortune 1000 company after not programming for 5 years and never having done web development that ran several processes for them and they used it for a decade. It was the ugliest code in existence but it was so easy to just update and after it was up it just ran, forever. Deployi…

> Deploying changes was just dragging over a file in Filezilla. Been thinking of building something new and considering learning node but PHP is right there. When I had to migrate to a new server I just copy - pasted the folders and away it went. These days most organizations will not tolerate just copying files over. There will be a process for testing the code and then stuff will probably be put in a container, to…

I think the point is that you can do both. Sometimes being able to yeet a PHP file to some PHP/wordpress hoster and get a project done in an afternoon is exactly what is needed, because even spending 2 or 3 days to set up a proper CI and deployment environment would be too much friction.

There is a whole range of projects like that out in the wild, once you leave the realms of startups and big tech.

It's about as easy to do "proper" deployment using bundles / containers / CICD / kubernetes / gitops with PHP as with any other stack. It's also possible to click a wordpress domain for $10/month and upload 2 php files and start making revenue.

For a small business that is starting up, choosing between $10k of freelance work to get a nice github actions workflow on GKE + a monthly retainer of $2k for "maintenance" vs a one time $1k of freelance work to get a wordpress where you can configure the plugins and theme yourself is a no brainer. Many of those small business then grow much larger and reach a point where in hindsight you can say "should have gone with docker containers". But the original decision was not just perfectly valid, but probably the only reasonable one.

Re: I still love PHP and JavaScript

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

The issue I have with php, having started building websites in the early 2000s with it, is that it is a language that doesn’t push you to write better code and progress. I am much more of a fan of static langages where the IDE guides you a lot more, gives you live feedback so that being curious is cheap, you don’t have to dive into some documentation to know what the other methods, parameters and overloads are, you can refactor code safely and effortlessly.

So I am sure some professionals write brillant code in php, particularly in large organisations, but my guess is that the median code base quality out there is probably pretty lousy. Anything below the 80th percentile probably too.

Also it’s for websites only.

Post reply on HN