Live data from Hacker News

PHP Sucks

evertpot.com

191–200 of 297 posts

Re: PHP Sucks

#191

The thing that hurts PHP the most is lack of structure and patterns used in the most popular projects. These popular projects are usually where the bulk of work lies, where developers point to when they're considering PHP. When juniors start they're typically working on WordPress or Drupal. The problem is that WordPress and Drupal are terrible guides of how to write a web app and that knowledge is completely useless…

> 7 is in no way compatible with 8 and you have to start over

There's an upgrade path, sort of, but more importantly major versions of Drupal live for years. I think we'll keep seeing new D7 projects for at least 2 more years.

Re: PHP Sucks

#192
post #179
post #62

Earlier quoted context omitted.

Have you tried Yii at all? In my most recent (side) project, I'm doing a Yii2 website and I'm feeling like it's not enterprisey enough. I have to go out of my way to figure out the best way to split things apart (which, I guess is good because it doesn't actually make that difficult for me at all - it's just something I have to choose to do)

I used Yii2 at a previous job. The way that it splits things out feels horrendous. The documentation is sub-par, and I feel like I spent more time trying to figure out why something didn't work the way I expected (from reading the code) than I did fixing things. I'm sure at least some part of that was the previous developer who built the application. But there is absolutely no reason for documentation to not answer t…

My experience has been 100% different from yours.

I commonly recommend Yii and laud it's extensive documentation and "Definitive Guide" that covers basically everything.

In my current experience as a developer, Yii's documentation is the best I've ever utilized. Much better than any Javadoc I've googled or even php.net's

Re: PHP Sucks

#193
For anyone wishing to look at a small modern PHP7+async codebase, check out https://github.com/Room-11/Jeeves (I am not involved with it). It shows the new guts of the language, and AFAIK some PHP core contributors wrote part of that code as well.

On the article itself, it is a mindset issue with people. Not sure how it is different from people saying "haskell is useless" or "JS is a toy language".

Re: PHP Sucks

#195
post #85

I started freelancing in my area doing Ruby on Rails, and found it far harder to maintain a project. I also found it harder to acquire clients in my area for new RoR development. More work was available locally with PHP. Clients were more willing to pay. I've done a ton of things in WordPress that shouldn't have been, "to save money". And I've done greenfield development with CodeIgniter, Laravel (v3 and v5), and a c…

I will say this: I whipped out the backend of a site in 1 night that had most of eBay's functionality... in PHP.

But I quickly moved away from it and I'll explain why.

I think that many programmers are starting to realize that the less "cognitive load" your language demands of you as a programmer, the better (the fewer bugs, etc.) Simple example, the recently-maligned "==" comparison operator has a very complex table of possible outputs (note that Javascript is also implicated here): http://stackoverflow.com/questions/7615214/in-javascript-why...

I mean, as a PHP programmer debugging code that used ==, you'd have to basically have that table memorized in order to successfully debug it. Contrast this with, say, Ruby, where only nil and false evaluate to false and everything else evaluates to true.

While there are of course "PHP best practices" that suggest === (which has a MUCH more sensible truth table), I find that much of the language is still simply not well thought-out and therefore is unsuitable for any large codebase. Sure, you can "get by" (see: Facebook), but you'd "get by" a hell of a lot better in a different (possibly a functional) language.

If you can't grasp all the cognitive load mentally, then you are invariably going to introduce unexpected states into your code (read: "bugs").

Lastly, a language should be 100% deterministic. Last time I checked, PHP didn't even consistently pass its own test suite. It literally has so-called "flagging" and "known-fail" tests which are just marked as such (and not fixed). I cannot explain how bad this is to build something else on top of.

So, yeah. If you're a great programmer, you can code almost anything in PHP (since you can handle the cognitive loads it introduces), just like you could code almost anything in, say, Brainfuck, or assembly. But as a great programmer, you'd be far better served by another high-level language (speaking as someone who knows and has worked with dozens of computer languages) which demands less cognitive load and therefore naturally reduces the number of bugs you will introduce.

I'll also plug John Carmack's piece on functional programming in object-oriented languages, because it's relevant: http://www.gamasutra.com/view/news/169296/Indepth_Functional...

Re: PHP Sucks

#196
post #152

Earlier quoted context omitted.

> More often it's the programmer who sucks, not the language. Catchphrase so ironic I laugh every time I hear it. The language also is written by a programmer, who sucked in PHP's case IMO.

>The language also is written by a programmer, who sucked in PHP's case IMO. Yes, I am a terrible coder, but I am probably still better than you :) - Rasmus Lerdorf Modern PHP is written and maintained by a team of programmers. It hasn't been the language Rasmus wrote (badly, as a hack he never intended anyone else to use) for years.

I wonder about the origin and context of all these quotes. This one was apparently tweeted by him and the full version is:

    "For all the folks getting excited about my quotes. Here is another - Yes, I am a terrible coder, but I am probably still better than you :)"
That is, unless there is actually a prior instance of him saying it but there could well not be.

Re: PHP Sucks

#197
The problem of PHP is its community of cheap workers not caring.

But I love them. As long as they stayed doing PHP they didn't contaminated other communities.

Now that they came to python with their bad practices exacly for the bad reputation reasons described in the article, I see PHP kind of coding ... SQL injections, shell injections ....

Please PHP coders I love you doing PHP, don't leave PHP.

Re: PHP Sucks

#198

While RoR, Python, NodeJS et al don't solve the most annoying issue for every developer: Deployment. Then they don't solve anything. And don't start talking about docker... that's a patch/hack to a serious problem, if i need an entire "jail manager" just to run your app then deployment is not as easy as you kins think it is.

if i need an entire "jail manager" just to run your app then deployment is not as easy as you kins think it is.

Incidentally, this attitude is why PHP is among the most popular target platforms among malware writers.

Re: PHP Sucks

#199
post #157
post #85

I started freelancing in my area doing Ruby on Rails, and found it far harder to maintain a project. I also found it harder to acquire clients in my area for new RoR development. More work was available locally with PHP. Clients were more willing to pay. I've done a ton of things in WordPress that shouldn't have been, "to save money". And I've done greenfield development with CodeIgniter, Laravel (v3 and v5), and a c…

>I'm very tired of hearing that PHP sucks. PHP is a good language And I'm quite tired of hearing this silly, totally meritless defense in every single thread that discusses PHP. Can't we just agree that it's not a very good language, but people are still doing cool stuff and lots of money with it? So many pointless fights could be averted like this.

A personal anicdote, but I run a SaaS, and there is an extremely pronounced (negative) difference in the sophistication of technical support queries asked by PHP devs vs those in other languages. This may be because PHP is so ubiquitous and approachable, but these types of silly questions (how do I make a POST call to your API?) are why PHP gets it's reputation.
Post reply on HN