Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

191–200 of 468 posts

Re: PHP is worth learning and using

#191

PHP is a lot better. But it still has a lot of the same old issues when you look beneath the service. Good luck remembering what all the str* functions they invented do and what order their arguments are in. Same for the array functions (don't get me started on implode's three signatures - but that's mostly fixed in 8!). And may His Noodly Appendages help you if you come across a function being used which has no docu…

Are str and array parameter order the only problem people have with PHP these days? Seems to be the only argument I come across now anyway

Nice work PHP

Re: PHP is worth learning and using

#192

Earlier quoted context omitted.

A very pragmatic reason exists: deployment is dead simple for users with very little technical skill. Deploying PHP software is as easy as subscribing to a shared web host (expensive or not, but most will make your life easy), connecting using FTP/SFTP, and extracting a ZIP file into the main directory. Some hosts even skip the last couple of steps and let you apply a template with a well-known PHP CMS to get you sta…

I'm a PHP fan, but I think the following needs clarification > package manager to install dependencies (PHP apps are self-contained) PHP has Composer, which is one of the best things to happen to the ecosystem. Chances are, the piece of software you install will manage its dependencies in this way, and I'd be reluctant to install it if it didn't, as you wouldn't be able to update the software easily.

It does, but it's mostly transparent to the user. I've never had to think about it when I was installing WordPress.

Re: PHP is worth learning and using

#193

Earlier quoted context omitted.

A very pragmatic reason exists: deployment is dead simple for users with very little technical skill. Deploying PHP software is as easy as subscribing to a shared web host (expensive or not, but most will make your life easy), connecting using FTP/SFTP, and extracting a ZIP file into the main directory. Some hosts even skip the last couple of steps and let you apply a template with a well-known PHP CMS to get you sta…

This argument may have worked in the years before Heroku (or Docker even) but it’s really outdated in 2021. Then you have the myriad of static site hosts that also take 2 clicks to host something without even having to write any code.

You must have not worked with small non-profits with zero technical expertise and zero budget for hiring a consultant/permanent paid staff. Heroku is overcomplicated, and Docker/static sites (or the command line/running a server of any kind) might as well be alien technology. Some orgs know just that little.

Re: PHP is worth learning and using

#194

Earlier quoted context omitted.

I like PHP and still use it today. But never in my life heard PHP is cool. Am I missing something?

If people call something "cool" - that's actually a red flag for me.

How's that policy working out for you?

If I did that I'd have missed a hell of a lot of cool stuff in life haha

Re: PHP is worth learning and using

#195
post #158
post #147

Earlier quoted context omitted.

I believe at least one of the options you listed is actually built with PHP (Shopify).

Perhaps, but you don't have to know or care about that that to use it.

Same with WordPress. You install it (or have it installed) once, and then never think about what language it's written in.

Re: PHP is worth learning and using

#196

Earlier quoted context omitted.

A very pragmatic reason exists: deployment is dead simple for users with very little technical skill. Deploying PHP software is as easy as subscribing to a shared web host (expensive or not, but most will make your life easy), connecting using FTP/SFTP, and extracting a ZIP file into the main directory. Some hosts even skip the last couple of steps and let you apply a template with a well-known PHP CMS to get you sta…

Does this really hold true in an App Service world? Just load your repo and go.

I'm talking about the kind of small org that doesn't know what a software repo is - zero technical experience at all, except for the very basics.

Re: PHP is worth learning and using

#197
post #12
post #3

This seems like a desperate attempt to justify not moving on from a language whose death knell rang a long time ago. You might as well try to convince me I should start my next business with cutting edge software written in Fortran or COBOL.

Here’s something to think about: You and some buddies start a startup whose product is a complicated piece of medical software that uses Tensorflow’s inference but most of it is written in Go. Cool stuff, you’d never do that in PHP. You’re getting ready to launch, and you’re going to need a marketing site and a site with documentation and help articles for users. Do you write that site in Go? Hell no. You hire someon…

Do you write that site in Go?

Honestly if all I needed was a marketing site and a place to host my documentation, I would 'write' it in something like Squarespace.

Re: PHP is worth learning and using

#198

Earlier quoted context omitted.

If people call something "cool" - that's actually a red flag for me.

That sounds fairly childish. Aside from the very obvious fact that you'll miss out on a lot of cool stuff, if you don't agree with the value judgements of your peers, the problem most likely resides with your choice of peers.

Red flag just means that you take a close and critical look - not that you automatically dismiss. And those "peers" are the people on the internet - f.x. blog authors.

Re: PHP is worth learning and using

#199

Earlier quoted context omitted.

A very pragmatic reason exists: deployment is dead simple for users with very little technical skill. Deploying PHP software is as easy as subscribing to a shared web host (expensive or not, but most will make your life easy), connecting using FTP/SFTP, and extracting a ZIP file into the main directory. Some hosts even skip the last couple of steps and let you apply a template with a well-known PHP CMS to get you sta…

> Hey presto, you have a functioning web shop, business website, charity home page, or whatever other thing you want. If we're talking about simple templates to open a store or a simple landing page there are so many no-code options like Wix/Shopify/SquareSpace/Square that I don't think PHP offers any significant advantage.

It's not that hard to get deplatformed, but yes, I can see your point. From an operational ease of use perspective they are strictly better than PHP, at the expense of trusting the providers to do the right thing.

Re: PHP is worth learning and using

#200

I don't really understand the reasons for using PHP outside of that people are already familiar with it and like working with it or want to find jobs in that area. If someone is new to software development and in an area of the world where it's not mostly PHP shops, so bigger cities, I don't really understand the benefit. PHP is often used to do certain things or it may be faster for you to whip something up in Larav…

> I don't really understand the reasons for using PHP outside of that people are already familiar with it and like working with it or want to find jobs in that area.

I look at it this way sometimes: there are the interpreted languages, the VM-based languages and then systems languages.

PHP is a good option in the "interpreted" languages category, if your problem domain is web-based, as it includes a lot of built in functionality for web-based problems. It's also open-source, reasonably performant, has an improved type system, has a C-like syntax and enjoys features inherent to a scripting language e.g. fast startup time, so would be a good option for lambdas.

Finally, one of the features that has been unreasonably good about PHP is the shared-nothing request model, which makes running a website on PHP a stable experience, in an imperfect world of weird state issues and libraries that might sometimes have a bug that leaks memory.

There are also other options in the "interpreted" category which I would fully expect people to also look into, however that's not to say PHP isn't a good contender for this space, given learning time is a limited resource.

However I would expect people to know a VM-based language and a systems-based language (or at least a bit of one) in addition.

Post reply on HN