Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

91–100 of 468 posts

Re: PHP is worth learning and using

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

But, what is, if not php? Do you shoot for what has had longevity, or what's rising?

It depends on what you want to do. The problem is that PHP is hyper-optimised for serving up HTTP. That was great in the 2000s when the web was eating the world and the other options were Java, Python, and Perl, but is less useful in the current climate where there's so many more platforms and web development requires javascript.

By learning PHP, you are effectively locking yourself into the narrow niche of backend web development (ask me how I know!), whereas other languages have much broader target platform appeal.

As an example, the obvious competitor to PHP of Javascript already beats PHP by also providing backend web services, but also has support from AWS lambda, GCP Cloud functions, and even the somewhat esoteric embedded javascript for micro-controllers options.

> Do you shoot for what has had longevity, or what's rising?

Coming back to your original question - I think it's both. Depending on what you wanted to do, I'd pick Javascript (see above), then depending on what else you wanted to do, one of Golang, Python, C#, or Kotlin.

Re: PHP is worth learning and using

#92

Earlier quoted context omitted.

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…

[deleted]

Re: PHP is worth learning and using

#93

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

So true. The time to market is unbeatable in PHP.

Not a fan, but that is definitely a very good argument.

Re: PHP is worth learning and using

#94
post #86

Earlier quoted context omitted.

There is never a best language. You make it sound like PHP is almost worthless in 2021 which is also not true.

There is probably a set of "good languages to learn" for every individual. There are two good reasons to learn a programming language: 1. You're using it for actual work 2. Learning it will teach you something fundamental I feel like the only way 2. might happen with PHP is if it's the first language you're learning.

PHP was my gateway to understanding C. It wasn't my first, but it definitely helped me learn more computer fundamentals than other languages.

Re: PHP is worth learning and using

#95
post #94
post #86

Earlier quoted context omitted.

There is probably a set of "good languages to learn" for every individual. There are two good reasons to learn a programming language: 1. You're using it for actual work 2. Learning it will teach you something fundamental I feel like the only way 2. might happen with PHP is if it's the first language you're learning.

PHP was my gateway to understanding C. It wasn't my first, but it definitely helped me learn more computer fundamentals than other languages.

[deleted]

Re: PHP is worth learning and using

#96
post #94
post #86

Earlier quoted context omitted.

There is probably a set of "good languages to learn" for every individual. There are two good reasons to learn a programming language: 1. You're using it for actual work 2. Learning it will teach you something fundamental I feel like the only way 2. might happen with PHP is if it's the first language you're learning.

PHP was my gateway to understanding C. It wasn't my first, but it definitely helped me learn more computer fundamentals than other languages.

Can you pinpoint anything in PHP that allowed you to gain such knowledge better than whatever your first language was?

Re: PHP is worth learning and using

#97
post #91

Earlier quoted context omitted.

But, what is, if not php? Do you shoot for what has had longevity, or what's rising?

It depends on what you want to do. The problem is that PHP is hyper-optimised for serving up HTTP. That was great in the 2000s when the web was eating the world and the other options were Java, Python, and Perl, but is less useful in the current climate where there's so many more platforms and web development requires javascript. By learning PHP, you are effectively locking yourself into the narrow niche of backend w…

Best since everyone is thinking along the same lines Javascript/Python/Go developers are quickly becoming a commodity; e.g there are millions or tens of millions of developers who learn them as their 1st language (many of them are now hirable remotely). Just worth noting I think...

Re: PHP is worth learning and using

#98

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…

If you like PHP, great. Do you plan on creating a start-up that you intend to scale to a babillion customers? That you intend to hire teams of developers for? Probably not a good idea. Are you a new programmer trying to figure out which language to learn first? Absolutely not. Python, Java, JavaScript, C# are much more flexible if nothing else. Anybody who tries to convince new programmers to learn PHP is doing them…

Except Facebook literally did that :)

But I agree with you.

Re: PHP is worth learning and using

#99
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).

Litespeed, or Apache+mod_lsapi are excellent alternatives.

If self-hosting, Nginx and FPM is well-tested and very fast.

Re: PHP is worth learning and using

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

I think the news of PHP's death came a bit too early. Most people I know claimed it was dead during the time Node was getting popular and people started pushing for things like websockets to make updating pages faster. PHP couldn't do that so people said it would die, and honestly if you were in a startup or a FAANG at the time it looked like it would. Everyone was moving from a REST web 2.0 model to a "live, concurrent users" model.

But the trend didn't continue. People did it for a whilw, but then moved on to other models which still worked for PHP because few apps really need live data and concurrency like that.

The problem for PHP is that the reputation for being "a dying language" stuck.

Post reply on HN