Live data from Hacker News

A look at modern PHP

lwn.net

351–360 of 610 posts

Re: A look at modern PHP

#351

Earlier quoted context omitted.

From a business perspective this might also translate into lower development costs and easier access to talent.

Generally lower quality talent. That's half the reason PHP got its abysmal reputation. Brilliant programmers using PHP must be annoyed that they're thusly tarnished. I suppose that's not so different from JS. To the flames with both of them, though, I find them genuinely depressing languages to work with.

Some (perhaps even most) problems don't need top tier coders, so hiring them for such problems is a waste of resources.

Re: A look at modern PHP

#352

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…

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.

Re: A look at modern PHP

#353

Earlier quoted context omitted.

Request processing in Java (or any other sane language) is Request-scoped. The Request is a variable, the Response is a variable, they're only in local scope? And any data the developer uses will also be local -- and thus stateless -- unless they go out of their way to share something. (Caches are a common example, but harder in PHP since nothing by default is shareable.) You don't need to deal with threads if you're…

I think what the comment really means by "request scoped" is that the PHP process is totally torn down after each request. In Java you can mutate global state as its running. You can leak memory until you OOM.

This.

One unfortunate side effect is PHP's choice to use the word "global" for what isn't really global but request scope. The "global variables are bad" folks look down on the PHP global scope just because of the name.

Tearing down the entire request after processing is (IMHO) a remarkable effective approach.

Re: A look at modern PHP

#354

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…

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

Re: A look at modern PHP

#355
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…

I think there is a huge difference between web sites and web applications. Most large applications today uses SPA and an api. The api can be done in any backend language and there is not many obvious benfits of using php but some clear drawbacks.

If you just want to create a web site quickly then php works fine but on the other hand you can do it quickly with js, c# or Typescript also.

Re: A look at modern PHP

#356

Earlier quoted context omitted.

I've done plenty of PHP programming (including modern) in the past. I'm excited about recent developments. Not sure about the productivity claim. I once wrote from scratch (frameworks excluded) backend and frontend (version 1) of a multi-tenant, cloud-based video-sharing platform with PHP as the backend (aws cloud) in a matter of weeks. I once wrote, from scratch (frameworks excluded), an entire backend (and front-en…

Can you attribute that specifically to PHP making that possible? Why couldn't an equivalently capable peer use Python to do the same?

So the claim was that PHP "gotchas" are a drain on productivity. I'm not trying to compare with other languages, but I think my anecdata shows that, at least in my case, when you understand the tools PHP can be a very productive one.

Re: A look at modern PHP

#357

Earlier quoted context omitted.

Majority of the HN commenters argue irrelevant points or are trolls and have never gone deep in any technology to be an expert and comment about it. I've seen absolutely moronic comments here. You should see the comments on 'React' or 'Java'. I'm pretty sure most have never written a "hello world" equivalent in it. It's cool to hate something popular.

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 rarely see comments like yours. You clearly mention that you used PHP a few years ago, so anyone reading your criticism will have that context and will want to try the newer version. Again, those who criticize should mention when they last used a language/framework and exactly what they didn't like about it. I've seen tomes written making fun of Javascript's type coercion when any "professional" JavaScript developer knows that the answer almost always is "strict equality".

Re: A look at modern PHP

#358
can anybody explain what is the purpose of static typing in a dynamic language ? It's not like you get benefit of compilation like java/C#.

Why is PHP trying to become java so hard, if there is already java and .NET ?

Re: A look at modern PHP

#359
post #346

This may sound hurtful but hear me out - One thing worth mentioning why someone would not want to use PHP in 2020 is that a PHP programmer is looked down upon by other programmers. And im saying this without hate or malice. I love PHP since I was a PHP dev from 5.2 - 7.0. I built PHP libraries and WordPress plugins that have helped many people. Ive since moved to Node because PHP jobs have dried up in my country. PHP…

In fairness the wheel has turned and node developers are seen as not respected. If you haven't moved to go/rust/serverless by 2018 the cool market has moved. When I got started in 2000, php developers weren't as smart as perl developers. Then it was asp. No serious business would use php over asp. Java developers always had this attutiude but they were always treated as second class from c++ developers who were treat…

As a fun, tongue-in-cheek project, someone should build a website with this timeline of languages going from cool to uncool.

For people who are busy with life and work, but who want to learn a new cool language, it would answer the question "what's the cool thing right now?". You look at the timeline, it's language X.

This also enables fun future oniony articles like "Go no longer cool", "Rust going the way of the dinosaur", "C++ is the new kid on the block", "Node.js is dead, long live X" etc.

Re: A look at modern PHP

#360

Earlier quoted context omitted.

I wonder how many developers hate PHP because one is just supposed to hate PHP. I'm sure there are many with well-thought-out reasoning though, like seen in this thread. It's useful to keep an open mind about things though. I'm probably more a PHP fan, but I can't say that I'm a huge fan of its programming style. It's much more enjoyable to me to churn out applications in .NET or in Ruby, but it's hard to argue with…

I think you're missing a third group of PHP haters that's actually a majority: those who've used PHP, sometimes extensively, and built up a backlog of "this is stupid" bits in their head about it. They don't have deeply reflective reasons or a strong theoretical basis for hating it, they've just suffered with it for a good while, found some better alternative, and are now sceptical that any amount of improvement will…

Yeah I mean the exact super dictionary bug that GP mentions also haunts Javascript, everything will be converted to string. But if you use Map and Set...

As you said, there's almost always a solution to avoid the pitfalls but that makes you more and more "unhappy" with the language over time. I'm one of the rare people who can answer most JS trick-questions correctly, and that puddle has been building for many years (let's say more than 10).

On the other side, I'm very pragmatic and using tools like ESLint and Typescript (well that's just JS with SUPER pragmatic typing in my eyes) started to make it a joy again in the last few years. I hope the trend continues. I can't say the same for my PHP experience.

Post reply on HN