Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

71–80 of 468 posts

Re: PHP is worth learning and using

#71
post #65
post #50

Earlier quoted context omitted.

Fine: python, ruby, go, rust, elixir, c, java, javascript, plenty more. Pick whatever you want. Just don't pick a language that is known to be on it's last legs.

> Just don't pick a language that is known to be on it's last legs. I’ve heard that exact sentiment over and over since the RoR community aggressively started with their anti-php agenda in about 2006.

Funny, Ruby seems like the language that's most obviously in decline right now. (Though as a Scala fan I shouldn't throw too many stones).

Re: PHP is worth learning and using

#72

Earlier quoted context omitted.

Python, JavaScript, Java, C# have all had great longevity, and much more popular, and can do anything that you can do w/ PHP and a whole lot more. Encouraging new programmers to learn PHP is cruel.

I'm still seeing shared hosts offer PHP everywhere at very cheap prices. That's not true for Java or C#.

Java and C# are not website-first languages and have never been popular on webhosts. They're still very widely used, maybe even growing; certainly I'd bet that both have a better growth rate than PHP at the moment.

Re: PHP is worth learning and using

#73
post #7

This seems like a false dichotomy. Is php totally worthless in 2021. Absolutely not. Is php the best language to spend your limited time learning in 2021? Almost definitely absolutely not as well.

Why are y'all arguing about this when you already learned like 20% of php by reading the OP. Learning enough of a high level scripting language like php to be able to be useful and productive in it is not some huge time sink, it's a few dozen hours of reading docs and tinkering

Re: PHP is worth learning and using

#74
post #70

For me the main turndown of using PHP is when I need to host the PHP website, php-fpm and Apache+mod_php seem to be the only two options. (FastCGI doesn't even have a proper specification).

swoole is a pretty interesting alternative as it allows asynchronous programming in PHP.

roadrunner is a PHP server developed using golang, utilizing goroutines for high performance.

both used by Laravel Octane, providing very easy integration with the framework.

Other than that, php-fpm & FastCGI allows integration with many interestin webserver including Nginx, Caddy, Lighttpd, etc.

Re: PHP is worth learning and using

#75
post #66
post #63

Earlier quoted context omitted.

Compare what the PHP jobs pay or the career path they put you on compared to elixir or ruby. Not even the same ball park. Not even the same sport.

> Compare what the PHP jobs pay Where? At Facebook? Or somewhere else?

yes, with the sole exception of facebook. If you really believe people are going out and learning php just to get jobs at faceboook I've got a bridge to sell you.

Re: PHP is worth learning and using

#76

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…

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 started. Hey presto, you have a functioning web shop, business website, charity home page, or whatever other thing you want. There's a (PHP) app for that.

In comparison, other programming languages are hard to figure out. Python, Ruby, Java etc all need some kind of a package manager to install dependencies (PHP apps are self-contained) and need to have the correct runtime version installed (PHP just needs to be in the general neighborhood of what's required, since most broadly used packages seem to be written in a backwards compatible fashion). This is scary and unfamiliar, and highly technical. If you're deploying on a VPS (because rarely anyone has managed Python/Ruby/Java hosting services), you've now also become the sysadmin with full responsibility for the box, including patching and downtime. Compared with shared PHP hosting, it's bonkers.

Re: PHP is worth learning and using

#77
post #67
post #50

Earlier quoted context omitted.

Fine: python, ruby, go, rust, elixir, c, java, javascript, plenty more. Pick whatever you want. Just don't pick a language that is known to be on it's last legs.

Purely from the outside (I don't really use either), ruby looks more dead than PHP nowadays.

How so? Ruby just released a new version with a JIT and new concurrency model. Rails is releasing a new major version later this year with a bunch of great improvements. Shopify, Stripe and others are putting a ton of improvements into the Ruby interpreter. Many large tech companies still use it. Many startups still use it. If nothing else, it's still a popular scripting language.

It's not as 'trendy' as it once was, but it's better than ever and still widely used.

Re: PHP is worth learning and using

#78
post #7

This seems like a false dichotomy. Is php totally worthless in 2021. Absolutely not. Is php the best language to spend your limited time learning in 2021? Almost definitely absolutely not as well.

Why are y'all arguing about this when you already learned like 20% of php by reading the OP. Learning enough of a high level scripting language like php to be able to be useful and productive in it is not some huge time sink, it's a few dozen hours of reading docs and tinkering

Opportunity cost.

Those "few dozen hours" reading PHP docs and tinkering could also be used to learn Python, Ruby, or Javascript, each of which are almost certainly better choices with broader applicability and more modern ergonomics.

Python gets you web backend + ML, Javascript gets you web backend + web frontend. Ruby gets you a multi-paradigm language with nice ergonomics and cats. PHP gets you job offers customizing Drupal and Wordpress websites.

If you already know a "scripting language most popularly used for websites", then you could choose to pick up Rust, Nim, Go, Swift, or Kotlin instead. It's much better to have a new kind of tool in your belt than a second hammer.

The world is full of so many choices. PHP has a lot of incredibly compelling alternatives. Unless your job demands PHP, you're probably better off looking elsewhere.

Re: PHP is worth learning and using

#79
post #7

This seems like a false dichotomy. Is php totally worthless in 2021. Absolutely not. Is php the best language to spend your limited time learning in 2021? Almost definitely absolutely not as well.

Why are y'all arguing about this when you already learned like 20% of php by reading the OP. Learning enough of a high level scripting language like php to be able to be useful and productive in it is not some huge time sink, it's a few dozen hours of reading docs and tinkering

The core language itself and stdlibs, sure, it'd take just several dozen hours to pick it up. That goes for any high-level, C-family programming language around today, really. Can you do that and be nearly as productive in PHP (or any other language) as you are in your current daily use language? No: you need to invest in learning common design patterns, the library ecosystem, and tooling in order to be productive at a high professional level, and that is a task that takes longer and arguably never even really ends. Putting down real roots in a programming language is a large investment.

Re: PHP is worth learning and using

#80
Excellent article. Learned much for this even though I have used PHP for about 20 years. PHP has vastly improved since version 7 - both in terms of language features as well as in terms of performance.

However, error handling continues to be an issue. It isn't uncommon for PHP to fail silently. That would be one complaint I have against PHP.

Post reply on HN