Live data from Hacker News

PHP in 2019

stitcher.io

391–400 of 489 posts

Re: PHP in 2019

#391

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…

Often when there is a post about PHP I read over these treads sort of subtly trying to figure out how a language with such a large user base has remained basically invisible to me. And I don't think I live in the HN bubble, though I do use a lot of Python, in my consulting work I've also done plenty of work with .NET, JVM to a lesser extent and other "boring" tech. But PHP has literally never come up, even as a sugge…

Here’s one right here!

In the world I’m in and the journey I’ve taken in my career of being in digital/dev for 10+ years, PHP is what I have based my dev foundations on. (albeit web rather than software)

I am recruiting PHP developers for my team now, and they are out there, but maybe not here?!

We make websites, and not a tremendous amount beyond that bar a few Laravel apps.

I suspect we travel in totally different worlds?!

Re: PHP in 2019

#392

Earlier quoted context omitted.

I dunno... Their home page looks like something out of the Panera Bread playbook looking at the homepage. 'Web artisans'? Why is it 'clean' because it has an absurd amount of whitespace and comments of platitudes for the code example?

"Clever" "marketing" language like this is not unique to Laravel, most frameworks use language like it for tag-lines on their homepage. Pyramid, a framework for Python, even goes with the same "artisan" language. They're just trying to be fun, inspiring, etc From the home page of a few other frameworks: Django: "The web framework for perfectionists with deadlines." Flask: "Web development, one drop at a time" Express…

They should have used "Laravel: The Framework Thomas Kinkade Would Have Created."

Re: PHP in 2019

#393

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…

I think the bubble has to do with purists vs pragmatists. I once joined a Java team as a front-end dev (I'm full-stack). They would do the back-end. They had done everything by the book perfectly. Following all the best practices. But the back-end wasn't doing what it needed to do by a long shot. They were stuck. Meaning I couldn't make progress. So I cooked up a simple (temporary) PHP back-end so I could easily buil…

I don't think so. "The bubble" is more about using shiny new languages like go and rust.

Re: PHP in 2019

#394

Earlier quoted context omitted.

I have to echo this. I worked on a data pipeline that was a mountain of PHP scripts bolted together with Bash and it was such a breeze to maintain. Using Symfony ensures that every command is well documented and consistent in design and use. Something I never appreciated about PHP until recently is that character encoding is so much more robust in PHP than other languages. We were forced to replace our pipeline with…

> character encoding is so much more robust in PHP than other languages. This is not what I expected -- my limited past experiences with anything outside of Latin-1 using PHP have been perplexing and not smooth (and I generally like PHP well enough). Can you elaborate on what features or approach can make things robust?

PHP doesn't care about your encoding. Therefore it's simpler to work with any encoding in it, because you're managing it manually.

Re: PHP in 2019

#395

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 often run into this argument - "inconsistent syntax", followed by zero proof. Then I wonder - is the person making the comment even using PHP or is the person behind the comment.. even capable programmer?

Yes, PHP has been "cleaned up" and you have always had the option to use clean, concise way of coding without language interfering or hindering you in any way.

There's no programming language out there that makes up for the sloppiness and inability of the person behind the screen.

Re: PHP in 2019

#396
post #153

Earlier quoted context omitted.

I was pretty anti-PHP before I worked for a multi-billion dollar company that was built on top of it. It's not a beautiful language, but it offers a lot of side benefits in terms of dev-ops, and tooling, and frameworks. As a company, the language was not something that held us back. The company moved really fast, and PHP was a large part a big part of why. In my career over the past 14 years I've done web work using…

Most of this would apply to Perl, as well. Which I can't fathom why Perl didn't easily beat out Python in the data science world. It's incredibly stable (version 5, that is), fast, and can just about rip apart and parse any raw data you have with ease. Python may "feel" newer, but there are only a few years age difference. Even Ruby isn't that much newer. Tragically, Perl developed its "unreadable" reputation because…

I maintain others Perl code and am no expert. Its our most use web tool and has been running for 10 years. I think Perl is different enough to confuse people who look at it (@,%,$) and it can make it hard to follow. I still have a little problems switching to it from other languages sometimes (do x unless y seems backward to me). I've also been told I write perl like a c programmer. Perl does have some beautiful parts though..

CPAN is great, but its hard sometimes when I just want to install something easy. It was the first great shared library and it shows its age a bit. Last time I ran it, it was compiling C code for some strange reason. We have trouble setting up shared perl environments, something we don'e have with python.

Biology has a lot of Perl code still, but it seems to moving to python.

Terrible code exists in many languages.

Re: PHP in 2019

#397
As someone who deeply misses Python (warts and all) and due to a job change forced to take on PHP (thankfully, we are on an aggressive language versioning schedule, so we're already on latest 7.3) as the full time language of of choice, I miss a few things that just make me want to pull my hair out:

For what its worth: I used (and personally still use) Python 3.6+ so the comparison is with that.

1. Async programming. While in Python its not perfect, having it baked into the core of the language makes so many things trivial like processing jobs between requests and sending the results back later, or having a simple queue for persisting data to a database after validation has been done on the data (Marshmallow is my hero for this).

2. Not having to worry about all the strange things you have to worry about when everything has to be re-built per request. While I understand WSGI requests are definitely this (kind of, usually you have a daemonized runner that keeps your app alive even then), your entire app did not spin down between requests like it does with php. Simply having to rebuild everything every single time a request comes in (even when using php-fpm, more or less) drives me insane, because I can't just send some data off to another channel in memory easily, or sleep a generator in a position and resume it when I need to. Everything has to be handled in said request. This kind of goes along the same lines as number 1, but its sort of a different problem (in particular, I think generators in Python are very elegant in comparison to lots of other languages, not just PHP (looking at you javascript), but PHP generators feel worthless unless I'm reading something line by line from a file or some other external resource, or I'm iterating against say, a doctrine array result)

3. Your app is full stop dead without a cache if you are planning on doing anything interesting. I don't just mean like opcache, but even small applications have to leverage this (APCU at a minimum), because of the aforementioned problem of nothing being alive after a request has been spun down. Yes, I have leveraged caching before, and yes I leveraged it all the time with python, but for just getting a quick prototype feature out the door, and adding those kind of layers later, I really miss that. Try iterating through database results non-sequentially, where you have tons of variable conditions on how that data needs to be shown, its a pain in the ass without caching aggressively (this is unfortunately a very real scenario I have to deal with all the time. We have non linear questionnaires in my current job I have to deal with, and the questions have to pass a certain validation and then we either have to get the next immediate result, or skip `x` ahead, without really knowing whats what or having any real idea of what anything may be keyed to. I'm open to suggestions if anyone has a good link or something to read on this kind of problem. I have not found it easy to work through personally with php)

With all that, Its been an OK experience though. Not my favorite language (may never be). However, if I was to postulate further, if PHP doesn't start gaining traction on these issues (and no, the weird async extensions are not a replacement for any of this. It needs to be core to PHP and maintained as such, for it to work in the language, in my not so humble opinion), it will eventually be supplanted in full even where it may have some strengths.

Unfortunately, nobody working on the core of the language seems to care about this at all.

Re: PHP in 2019

#398

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 often run into this argument - "inconsistent syntax", followed by zero proof. Then I wonder - is the person making the comment even using PHP or is the person behind the comment.. even capable programmer? Yes, PHP has been "cleaned up" and you have always had the option to use clean, concise way of coding without language interfering or hindering you in any way. There's no programming language out there that makes…

Back in the PHP 3/4 days, a lot of related functions would have different argument orders.

str_replace(old, new) vs. stri_replace(new, old) kind of thing.

Re: PHP in 2019

#399
post #262

Earlier quoted context omitted.

The vast majority of people using a package manager in the PHP ecosystem are using composer. It makes sense to call it "the" package manager.

I’d argue that the only “the” is one that’s distributed with it, which is PEAR. I’m not saying PEAR is used more or that it’s better, just that it’s the only one close to “default” with the language distributions.

pear/pecl are more for installing extensions TO php in my experience, where composer is for installing packages built IN php, so composer is more the defacto community package manager, pear/pecl are useful though when you need to install gmp, gdi, intl, etc on your local dev environment. I don't know anyone who uses pear to install carbon or guzzle, or any other php package though.

Re: PHP in 2019

#400
post #2

I've actually been really impressed with Laravel after switching back to PHP for a few projects. Not only is the developer tooling experience some of the best I've experienced, it's just really the only framework I've ever experienced with a high quality ecosystem of tools—from Forge[1], which makes it dead-simple to deploy a Laravel app into production to things like Horizon, for managing Redis queues. A great examp…

Last time I used composer (about 3 years ago) it had a nasty memory leak that eventually meant I had to run the build on a higher specced instance than the actual application. This was mainly due to the ridiculous dependancies of the application, but it was almost a show stopper. Has this improved?

It is not a leak, it just loads too much data into memory so you need about 1 Gb of RAM to run composer update.
Post reply on HN