Live data from Hacker News

A look at modern PHP

lwn.net

401–410 of 610 posts

Re: A look at modern PHP

#401
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

Go and Rust were designed for other things... why wouldn't you compare it to the big language that was actually designed to compete in the same space as PHP? NodeJS. Front end devs are already programming in JS, so there's less adoption cost than PHP. I can't think of a single reason to use PHP over Node (I know both, and have delivered projects in both). The comparison to .Net and Spring makes me think you might be…

> can't think of a single reason to use PHP over Node

Symfony, Laravel, Drupal and Wordpress would be reasons.

Re: A look at modern PHP

#402

Earlier quoted context omitted.

> if you try to use a string as a key, but it is a string of digits. It will automagically(sic) convert your string to an int and totally F-up your dictionary I've been a PHP programmer for over 15 years and I cannot think of a single time this has been an actual problem. It sounds like you were embarrassed by a bug in your code and have just decided to blame it on the tools.

My guess is that the numeric indexing thing happens a lot but it's definitely rare for it to cause a visible problem and even rarer to be identified as the cause since it is unexpected. I've been bitten by it and also stuff like 800=="8E2". I've never been able to make an adequate defense of PHP, yet also have never seen another language match its success rate of getting useful software into the hands of users. I hav…

I'm in a similar boat. I've decided that whatever it is that makes PHP successful must be exactly the same thing that has made JavaScript successful.

It's going to sound extremely condescending, but here it is, anyway: I believe that the majority of people who defend PHP (and JavaScript) are people who have ever only written code in Java (especially <=1.6), JavaScript, and PHP. Maybe C for fun or in college. In light of those immensely popular languages, I could see why someone might not think that any of the deficiencies are deal-breakers.

Re: A look at modern PHP

#403
post #200
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

Most of the comments against PHP are from developers that wrote PHP There are still some issues but considering the current state of language, frameworks, libraries, and the ecosystem, it's very practical and productive environment to build any project. I've been doing Typescript, Scala, and recently also Go in last few years. Scala and Go have decent language design and I'm a fan of both of them. But, when it comes…

PHP 4 was the last time I wrote any PHP; I hated it. You are right, though. PHP now is not the PHP I knew.

Re: A look at modern PHP

#404
post #371

Earlier quoted context omitted.

Some of commenters are "ex" php develops. For me PHP was painfull but I didn't know that until I moved on to Ruby and now Go. I would never go back to PHP programming(i tried few years ago) just like I would not go back to Windows(except for budget or political reasons). PHP was fun back in the day because you could host it anywhere and truth be told it was an easy scripting language to learn but I don't see many rea…

I have similar experience. Left when it was still 5.* something. Now I mainly do TypeScript/JavaScript and some Rust on the side. To me, PHP was more of a limiter rather than painful experience (it was a bit painful though). I couldn't imagine how to even make a chat app. If not for my moving out of PHP to NodeJS now I wouldn't be a software architect and explore the rest of the fun and challenging part of computing…

I started out with PHP at a very very young age and eventually moved on to other platforms (mainly Python). Not looking to question your experience - but actually recalling my own. Making a chat app was one of the first things I did. It was a super basic CRUD app mixing HTML and some code, refreshing the page every few secs, thanks to some meta tags.

Of course, it used frames, so that the "send message" part didn't clear every time it refreshed… those were the days! Eventually, my fancy chat app delivered a much better user experience, thanks to an amazing (back then!) JS library — jQuery. I built my first "API" that way! (It didn't use XML or JSON - it just returned chunks of HTML that were appended to a div).

Pure PHP gets annoying when you're dealing with complex data models, or when you're building a combination of frontend plus backend batch processing. Frameworks such as Laravel make this much much nicer to deal with IMHO. Of course, PHP is far from perfect, and its quirks can cause OCD and frustration to some people… :-)

But thanks to PHP (and also thanks to how lenient and chaotic it was), I was able to create very early on without needing to worry about software patterns (I had no clue what MVC was back then!), strict code formatting, learning how to deploy an app (just upload the code and off you go), and so on. PHP got me into programming — and it's also propelled some big-name sites and apps, so I guess it deserves some credit there as well.

Re: A look at modern PHP

#405
post #352

Earlier quoted context omitted.

I'm a PHP "hater", so take this for what it's worth. You are very close to implying that the language doesn't matter if you can hire developers and there are a lot of good packages in the ecosystem. Having worked on several PHP projects (Most being version 7.0+ and zero of them being older than 5.3), the languages is STILL full of gotchas, and it's a huge drag on productivity. I assert that this DOES matter. Even bas…

Sounds like a jr dev misstep... you're not really bringing up any key points.

It takes 5 seconds on Google to find a myriad complaints about weird, unexpected, and downright incorrect things that PHP does. That wasn't the point of my reply. The point was that language choice CAN affect productivity. And having a bunch of gotchas is something that will negatively affect productivity. I simply gave the first example that popped into my head that actually tripped me up.

Re: A look at modern PHP

#406

Earlier quoted context omitted.

> if you try to use a string as a key, but it is a string of digits. It will automagically(sic) convert your string to an int and totally F-up your dictionary I've been a PHP programmer for over 15 years and I cannot think of a single time this has been an actual problem. It sounds like you were embarrassed by a bug in your code and have just decided to blame it on the tools.

I've run into that numeric reindexing confusion. PHP arrays in general are so feature rich it's also easy to overuse them. The proliferation of Collection classes may be one side-effect of how poweful-yet-awkward they are.

Is "powerful" really even the right description? I can't even do a map + filter without looping through the array twice. Ew. I guess I'll just stick with the primitive foreach loop (which leaves a dangling allocated object after you use it... sigh).

Re: A look at modern PHP

#407

I wonder if most developers that trash on PHP for trivial issues like seen in this thread haven't been using it for many years, or had a bad experience (e.g. maintaining a legacy app). Some developers live in a kind of technical vacuum where, I guess they assume, the technical features of their programming language are what makes the difference in the value of the business they're building. In reality, the difference…

Not gonna lie my #1 complaint is that PHP jobs on average pay like shit in comparison to most other things. I don't want to work with it solely because it has no value on my resume.

That being said the biggest argument for PHP is productivity and I just prefer Ruby + Rails for that. Honestly though I will say I find PHP more pleasant to work with than Python these days.

Re: A look at modern PHP

#408

Earlier quoted context omitted.

Define proper please.

No native support for concurrency operators, no real event loop implementation, lack built-in support for non-blocking IO... I do Elixir regularly and Actor Model is not something PHP developers know

Look into ReactPHP, Swoole and Spatie

Re: A look at modern PHP

#409

Earlier quoted context omitted.

Funny, I remember everyone hating on PHP when they moved to RoR, and now they hate that are and moving on. Its almost as if they just need things to hate so they can rewrite code. its very cyclical IMO. The elitism of learning a new language and then mocking those that haven't put in the same time and effort to row in the exact same direction, has always amused me. Ive never judged anyone for what tools they use to g…

This and the parent comments are assuming that all language criticism boils down to tribalism/elitism and not problems with the language itself, as if all PLs are the same, and the choice to use them is arbitrary.

I mean the choice isn't literally arbitrary but it matters a lot less than the ecosystem and you can't really make a wrong choice as .NET, JS, PHP, Java, Ruby, Python, Go, $ReasonablyPopularLang are all plenty productive.

Re: A look at modern PHP

#410
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

There are some clueless people posting their ignorant opinions here, like some dude was hating on the guy that invented XML, sure XML might not be the best tool for everything but I can't see yaml or json to be better for documents, the thing XML was created for (but the guy probably has no idea what XML is, how it is used correctly), probably could be a good interview question to see who is inexperienced but has a giant ego and thinks he knows much.
Post reply on HN