News for hackers. Stuff that matters.
Re:PHP is worth learning and using by brailsafe on Wednesday November 17, 2021 @10:48PM (#29261795)
But, what is, if not php? Do you shoot for what has had longevity, or what's rising?
Re:PHP is worth learning and using by solraph on Thursday November 18, 2021 @01:26AM (#29262560)
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 by forgotmypw17 on Thursday November 18, 2021 @03:47AM (#29263446)
Most languages lock you into one type of niche or another.

I'm quite happy with the Web niche, it's one of the longest lived, the stablest, the most open, and has some of the longest backwards-compatibility records around.

I can write a website today which will work in 25 years worth of client software! I think that's remarkable.

Re:PHP is worth learning and using by FranOntanaya on Thursday November 18, 2021 @08:59AM (#29265419)
PHP pays my bills. I don't use it for web backends, it runs automations for a number of operations that glue APIs together, as well as exporting some custom document types and sorting out workflows/data.

Simplistically speaking, all I have to do is stick the path hashbang at the top of a php file, follow with the business logic and run it as a shell script. Clears any urgent ad-hoc request within a day.

Re:PHP is worth learning and using by joelbluminator on Thursday November 18, 2021 @01:32AM (#29262612)
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 by solraph on Thursday November 18, 2021 @03:22AM (#29263318)
From brutal experience I can tell you that's also been true for PHP programmers for a long time.
Re:PHP is worth learning and using by joelbluminator on Thursday November 18, 2021 @04:50AM (#29263799)
Maybe still. But I'm pretty sure 5-10 years from now PHP devs will be in demand since everyone is moving to Node/Go/Other Hype.
Re:PHP is worth learning and using by guitarbill on Wednesday November 17, 2021 @11:01PM (#29261840)
If you could predict the future, it'd be easy. And you can pretty much learn any language.

The question is who's hiring/where will you work, and what will you work on? In my area, there aren't many PHP shops. So it could be Wordpress or Facebook/Meta. PHP might be long-lived, but if you have to relocate to find a PHP job, does that help? Same with e.g. COBOL, Sharepoint, etc. And to be fair, what's rising has that problem outside tech centres.

Something popular like Python is generally a "better" investment, covers more bases.

Re:PHP is worth learning and using by skinnyarms on Wednesday November 17, 2021 @11:32PM (#29261996)
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.
Re:PHP is worth learning and using by brailsafe on Wednesday November 17, 2021 @11:59PM (#29262114)
Encouraging new programmers to learn Java isn't cruel? "Son, today is the first day of a long journey into enterprise software development. Yay"

It is cruel, and something Universities have been doing forever.

Re:PHP is worth learning and using by skinnyarms on Friday November 19, 2021 @12:28AM (#29274128)
You prefer customizing wordpress?
Re:PHP is worth learning and using by dragontamer on Thursday November 18, 2021 @12:11AM (#29262178)
I'm still seeing shared hosts offer PHP everywhere at very cheap prices.

That's not true for Java or C#.

Re:PHP is worth learning and using by lmm on Thursday November 18, 2021 @12:29AM (#29262267)
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 by anm89 on Wednesday November 17, 2021 @11:21PM (#29261952)
But what is, if not Visual Basic? Do you shoot for what has had longevity, or what's rising?

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

Pointing out that there is not absolute certainty about what is the top choice for a better idea does not make php, or visual basic, or 68000 worth spending your time on in 2021.

Re:PHP is worth learning and using by anm89 on Wednesday November 17, 2021 @11:26PM (#29261975)
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.

Re:PHP is worth learning and using by detaro on Thursday November 18, 2021 @12:21AM (#29262209)
Purely from the outside (I don't really use either), ruby looks more dead than PHP nowadays.
Re:PHP is worth learning and using by Mikeb85 on Thursday November 18, 2021 @01:04AM (#29262429)
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 by Zababa on Thursday November 18, 2021 @01:14AM (#29262480)
> 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.

Do all of these make it faster than PHP?

Re:PHP is worth learning and using by joelbluminator on Thursday November 18, 2021 @06:33AM (#29264329)
> Do all of these make it faster than PHP?

We'll need to look at it a year or two from now and compare oranges to oranges; the new Ruby JIT (YJIT) is optimized for real world web apps, not for some artificial fibonacci benchmark. Shopify is using benchmarks on actual Rails apps like their store front to see the improvement (https://speed.yjit.org/). If I had to bet I think yes Shopify is serious enough about this to make Ruby faster than PHP - who is working on PHP internals now - Zend? In the end it's mostly a question of how much resources you throw at a problem.

Re:PHP is worth learning and using by Mikeb85 on Thursday November 18, 2021 @01:38AM (#29262662)
Is speed the only measure of a programming language?

Honestly, I have no idea how it compares to PHP. If I wanted truly fast I'd use a compiled language. The point is more that Ruby is still being used and improved upon all the time; far from 'dead'.

Re:PHP is worth learning and using by mgkimsal on Thursday November 18, 2021 @10:50PM (#29273606)
> The point is more that Ruby is still being used and improved upon all the time; far from 'dead'.

Exactly the same with PHP. The handful of Rails devs I know bemoan the fact that fewer shops are growing their Rails/Ruby use. I did a stint at a shop that was mainly PHP, but they migrated most stuff to a combination of node and python, because "they couldn't find php developers". While it was sort of true, they couldn't find affordable php devs to work with the legacy mess (which was only 5-6 years old), and it was cheaper to have less experienced (but more) node/python folks come in and rebuild distinct bits of the older PHP stuff (at least, that was my understanding as an outsider - this happened after I left).

Some orgs are moving away from PHP - others are moving towards it. Same with Ruby, although I don't see as much movement toward Ruby as I do with PHP. But I do also see orgs moving away from each.

Re:PHP is worth learning and using by detaro on Thursday November 18, 2021 @01:46AM (#29262701)
Ok, so similarly "dead" (or not) as PHP.
Re:PHP is worth learning and using by brailsafe on Thursday November 18, 2021 @12:02AM (#29262127)
Ya, but PHP is actually still being used in a lot of agencies and in certain types of work. Far more than elixer and rust, probably just below ruby.

Also I wasn't pointing out what you say, you're reading into it a bit. I haven't used PHP in a long ass time. But it seems like not a bad choice for certain markets, at least as much as Python and Ruby imo

Re:PHP is worth learning and using by Zababa on Thursday November 18, 2021 @01:15AM (#29262487)
PHP is used far more than Ruby. Wordpress alone dwarfes any Ruby usage.
Re:PHP is worth learning and using by brailsafe on Thursday November 18, 2021 @05:37AM (#29264023)
I guess it depends how you quantify it, but I was thinking Shopify's use of Rails would have started competing for %
Re:PHP is worth learning and using by Zababa on Thursday November 18, 2021 @10:57AM (#29266877)
That's a fair point, I implied individual websites instead of % of traffic on the internet. I interpreted this thread mostly to be about number of jobs, in which case I think the number of websites is more important than the percentage of traffic, but I should have been explicit about it.
Re:PHP is worth learning and using by anm89 on Thursday November 18, 2021 @12:11AM (#29262176)
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.
Re:PHP is worth learning and using by monkey_monkey on Thursday November 18, 2021 @07:56AM (#29264878)
I bill £650 a day for 'PHP development'.

What is this out of the park career path I'd have had choosing ruby? Can you share some more details?

Almost the best advice I can give to a developer is stop being fixated on language, and start being fixated on how to solve business problems, on communicating coherently (and like a human being), and being able to quickly grok complexity. The language you program in is almost the least important part of the offer (as long as you're competent in it)

Re:PHP is worth learning and using by jhgb on Thursday November 18, 2021 @12:20AM (#29262206)
> Compare what the PHP jobs pay

Where? At Facebook? Or somewhere else?

Re:PHP is worth learning and using by anm89 on Thursday November 18, 2021 @12:45AM (#29262334)
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 by joelbluminator on Thursday November 18, 2021 @01:55AM (#29262759)
Hack isn't PHP anymore...
Re:PHP is worth learning and using by dreyfan on Thursday November 18, 2021 @12:18AM (#29262199)
> 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.

Re:PHP is worth learning and using by lmm on Thursday November 18, 2021 @12:27AM (#29262249)
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 by simion314 on Thursday November 18, 2021 @02:04AM (#29262831)
I bet that there is a bigger demand for PHP devs then all the Rust,Go and Elixir combined.

So if you need a job you would probably have better chances knowing PHP then knowing Rust. But if in your area is raining with Rust jobs then go ahead and learn only Rust.

Re:PHP is worth learning and using by vegai_ on Thursday November 18, 2021 @01:26AM (#29262559)
If you have to learn a new language for some reason and you don't know what to pick, go for something that has things you've never done before. Perhaps consult TIOBE for extra data points if you value current popularity.

Some popular choices in this bubble seem to be:

- clojure

- common lisp for some reason

- php is mentioned often here, also not sure why

- rust

- swift if you're into ios/apple, kotlin if you're into android

- typescript

Re:PHP is worth learning and using by eyelidlessness on Wednesday November 17, 2021 @11:01PM (#29261844)
I can’t tell if you’re arguing for PHP or against COBOL. I kid, but a lot of the other languages/ecosystems people will consider investing in are at least as old and evolving right alongside PHP. Many of them with very similar evolutions.
Re:PHP is worth learning and using by brailsafe on Wednesday November 17, 2021 @11:08PM (#29261882)
Ya that's basically what I was getting at. Not about COBOL, but about others that are similarly long lasting in the market, dynamically typed, and general purpose.