Live data from Hacker News

PHP in 2019

stitcher.io

101–110 of 489 posts

Re: PHP in 2019

#101
post #21

Maybe it isn't, but other languages/frameworks have improved the past ten years as well. I don't see the selling point in building something in PHP in 2019 when you have similar if not better/more mature languages/frameworks at your disposal. Won't your prototyping be faster in Go/Python/Node/Ruby anyway, with a more stable surface to build upon it? I really fail to see where PHP has its place in 2019. For your "buil…

Stable? Big e-shop I wrote in 2005 in PHP works without any compatibility issues until today. No need to re-compile anything, to fix bugs in the runtime, etc.

Ruby was some obscure language just gaining acceptance back then, node didn't exist, golang didn't exist, C# has just invented iterators.

PHP showed over the years that it was a stable and painless surface to build on. And I don't see it changing.

Re: PHP in 2019

#102
post #98
post #86

Earlier quoted context omitted.

I usually code a backend in Go or Python, but recently been thinking if I should just abandon my "prejudice" (JS sucks, Node sucks, Node is single threaded, there are no SQL libraries, etc) and move to JS on the backend as well, since that's what I already use on the frontend - be it web or React Native. (I actually find JS very expressive and oriented towards a style of "table-oriented programming" which is useful f…

> (JS sucks, Node sucks, Node is single threaded, there are no SQL libraries, etc) and move to JS on the backend as well, since that's what I already use on the frontend - be it web or React Native. My prejudice is the same. A lot of JS and its ecosystem feels to me to be broken by designs, but you have an option to use a boutique option of Scala/Dart/Go that nobody uses (relatively speaking,) or JS which is broken a…

Putting Go in the same box as Dart seems a tad insulting - it's not that much of a niche language anymore.

Re: PHP in 2019

#103
post #21

Maybe it isn't, but other languages/frameworks have improved the past ten years as well. I don't see the selling point in building something in PHP in 2019 when you have similar if not better/more mature languages/frameworks at your disposal. Won't your prototyping be faster in Go/Python/Node/Ruby anyway, with a more stable surface to build upon it? I really fail to see where PHP has its place in 2019. For your "buil…

Referencing "go" and somehow smuggling in 'mature' in there without mentioning the dependency management situation is ... disheartening. There may be many reasons to like the go language, but the dep management issue doesn't seem solved at all (last viewed in Nov 2018 - maybe it's all magically better and there's 80% community consensus and everything is smooth now?)

Re: PHP in 2019

#104
On one hand, I do see that HN (and probably Reddit) live in a bubble. Where most of the darling languages and tools have very low use in the real-world. And where most of the languages and tooling that actually run the real-world go un-discussed, or simply dismissed, because they're boring and don't appeal to students and entry-level devs working on side projects. I realize that the perspective most rookies get from these forums is completely distorted.

On the other hand, I ALSO think that PHP is only still relevant because of WordPress. The business world runs on Java, and .NET to a lesser extent. I see job postings for Python all the time, as it and the JVM run the worlds of data science and big data. One can even still make a thriving living with Ruby. But I just don't see any recruiter activity around PHP at all. And whereas my Java shop will hire Python or Node junior devs, on the theory that they can learn, we would more likely to skip over a PHP-based resume (if we ever actually saw any).

Re: PHP in 2019

#106
post #51

As far as I'm concerned the bridges have burned a long time ago and I definitely can't see myself giving PHP a second chance. That being said, if I'm wrong and PHP has really managed to become a decent language (or at least something that's not completely insane) its defenders should focus on actually showing what modern PHP code looks like. Is performance that much of a big deal for most people? In a world where Rub…

>I assume that these obsolete functions and operators still linger for backward compatibility? If so how do you avoid them?

This. If there isn't a linter that bombs out on those things that used to be standard PHP, modern PHP is a non-starter. There are too many bad examples out there that will make their way into modern code if you let them.

Re: PHP in 2019

#107
post #82
post #51

As far as I'm concerned the bridges have burned a long time ago and I definitely can't see myself giving PHP a second chance. That being said, if I'm wrong and PHP has really managed to become a decent language (or at least something that's not completely insane) its defenders should focus on actually showing what modern PHP code looks like. Is performance that much of a big deal for most people? In a world where Rub…

What ended PHP were not the worst parts of its design, but upstream's unwillingness to simply change the language for better. See, as a commercial enterprise (begware as a business) all kinds of "foundations" and sponsorship pools surrounding the language already accumulated a big enough pool of clients who were happy enough with PHP as it was in 4.0 era. They had no intensive to progress. Especially if their busines…

I think ended is pretty strong word for a language that powers a huge portion of the web. Yes the lang. has issues and yet WordPress, Magento etc. are used an order of magnitude more than alternatives written in other languages.

Re: PHP in 2019

#108

Earlier quoted context omitted.

Is that and more, I mean everyone uses classes and namespaces now and structures code better so there is this improvement. Projects use autoloaders now and things again are better. Have a look for example http://image.intervention.io/getting_started/installation how you would resize an image if you used a framework, it is much different then you would see in a code that was written 20 years ago.

You mean to say that namespaces and classes are an improvement?

Yes, you mean you want everything in a global space, you have then issues where 2 dependencies define the same type named "Task" and on dev machine a different Task is initialized then on production (it happened to me when working on an old code base that was not using namespaces).

If you are an anti OOP person then I would prefer not to debate here religions.

Re: PHP in 2019

#109

Earlier quoted context omitted.

https://crystal-lang.org

despite it's pre 1.0 status it's arguably more production ready than php ever was/will-be etc.

I bet you rely on things written in PHP way more than you realize.

Re: PHP in 2019

#110

The thing that matters is language consistency... A language with a pure clean vision of itself in which the programmer can guess at syntax because they understand the general syntax principles to which the language adheres. Nothing here says PHP has been fixed in this regard. Python made the big leap and fixed some huge problems when it went to python 3 - yes it's migration approach was a total fail, but it further…

I've been coding in PHP for almost 20 years now. I think I can count on one hand the number of times where I have had an issue regarding inconsistent function signatures. It becomes second nature, and if I forget, the documentation is available online or in worst case built into my IDE. I can understand why people make this into such a pain point, but quite frankly it isn't for anyone who works day in day out with PH…

That's what really gets me.

Anyone that works with PHP on a daily basis very quickly gets used to some of the naming differences or inconsistent signatures. Anyone that works with PHP rarely is almost assuredly going to have to look it up regardless of how inconsistent it is. (do people really guess at function names, signatures, and return values in other languages!? I've guessed that they exist, but I don't ever think i've tried something without first checking the docs just to see about any surprises or differences)

Consistency is nice to have, but it's pretty far down the list of requirements in my opinion. If it's different for some, I can see how they wouldn't like PHP, but calling for it to "clean up" it's syntax in a giant "python-3-esque" move seem really misguided. People who program in PHP regularly don't really mind the warts, and the language has improved significantly in areas that it's users found most important. Types slowly working their way into the language, easy closures, traits, nice new operators, and the massive speed and memory usage improvements have all been very welcome improvements that have made me more productive in the language.

The time spent on "cleaning up" the standard library would be a welcome change by most, but it wouldn't really have any material impact for me or any of the other PHP devs I know.

Post reply on HN