Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

391–400 of 402 posts

Re: I still love PHP and JavaScript

#392

Earlier quoted context omitted.

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.

And will your database, webserver, php and linux auto update itself next 20 years?

Reality of that is that most people will use some plugins or their theme wont update or your code will have breaking change.

The auto update is nightmare. Because so many people are trying to hack WP you gotta do it and every other update becomes stresfull event. Good luck updating someone elses plugin.

Much higher chance of website working 20 years is - take simple preferably file based system. Make manual update every 5 years. If its good system then the migration will be well documented and painless probably taking 5 minutes.

Re: I still love PHP and JavaScript

#394
post #202

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.

> Having said that php has one really very big thing going for it - people who use it are simply addicted to getting things done. does that mean every other language the people don't get anything done?

Not at all. Just seems like PHP people are laser focus on getting things done maybe because the language and it’s runtime is so primitive there aren’t any distractions

Re: I still love PHP and JavaScript

#395
post #377
post #299

Earlier quoted context omitted.

> JavaScript even its inventor said it's time to move on. I hadn't seen that quote, do you have a link?

Probably meant JSON instead of JavaScript https://evrone.com/douglas-crockford-interview

I stand corrected.It was Crockford not Eich.

Re: I still love PHP and JavaScript

#396

Earlier quoted context omitted.

> That is a ton of wasted work, and there are literally sections in the PHP docs about tools to circumvent this problem.[0] Install opcache, done. No need for hyperbole.

Good to know it's that easy. Do you ever run into race conditions? And how does it handle cache coherency?

Opcache is integrated into PHP since 5.5. It's been stable for around two decades.

https://www.npopov.com/2021/10/13/How-opcache-works.html

Re: I still love PHP and JavaScript

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

Perhaps those people are stuck with PHP 5.

Re: I still love PHP and JavaScript

#398

Earlier quoted context omitted.

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

[deleted]

Re: I still love PHP and JavaScript

#399
post #309

Earlier quoted context omitted.

> PHP was really nice to get into programming and make a spaghetti website Facebook manages quite well with PHP. Maybe it's your fault you didn't learn how to use modern PHP practices which have been well-documented for over a decade now.

>> Facebook manages quite well with PHP. I didn't say you can't make it work. You can build great stuff using just bash scripts. I'm pretty sure you can have success with any programming language. That doesn't mean it's the "best" way to do it. >> Maybe it's your fault you didn't learn how to use modern PHP practices which have been well-documented for over a decade now I doubt it's my fault. I'm not "special". I thi…

> I doubt it's my fault. I'm not "special". I think PHP is prone to bugs and bad practices both due language design and bad documentation.

Not in 2022. I avoided PHP for a long time. I got back to it and found that the Internet and books are full of best practices and I have not had an issue with documentation either. Would you please give me an example of how PHP is more prone to bugs vs. other languages in this area? I have found it to be really difficult to write buggy and insecure code. For example if you have not heard of PDO and you do not prepare, bindValue/bindParam, and then execute, that is your fault (make use of filter_input() as well!). It is advised literally everywhere today. Regardless, my return to PHP was pleasantly surprising. I finished my project pretty quickly and I have not used any frameworks. Security vulnerabilities? Perhaps, but so far so good. We will see. I tried my best and I have done my research. Every time I mention that it is written in PHP, people frown because they are stuck at PHP 5 or so. That said, subpar defaults in php.ini is still a thing though.

Re: I still love PHP and JavaScript

#400

Earlier quoted context omitted.

>> Facebook manages quite well with PHP. I didn't say you can't make it work. You can build great stuff using just bash scripts. I'm pretty sure you can have success with any programming language. That doesn't mean it's the "best" way to do it. >> Maybe it's your fault you didn't learn how to use modern PHP practices which have been well-documented for over a decade now I doubt it's my fault. I'm not "special". I thi…

> I doubt it's my fault. I'm not "special". I think PHP is prone to bugs and bad practices both due language design and bad documentation. Not in 2022. I avoided PHP for a long time. I got back to it and found that the Internet and books are full of best practices and I have not had an issue with documentation either. Would you please give me an example of how PHP is more prone to bugs vs. other languages in this are…

Do you have any book recommendations for someone who knows web development but is new to (modern) PHP?
Post reply on HN