Live data from Hacker News

PHP Sucks

evertpot.com

231–240 of 297 posts

Re: PHP Sucks

#231

Earlier quoted context omitted.

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.

Yes, the biggest strength of PHP is that anyone can pick it up quickly... which means anyone will. There are "best practices" but they're not necessary to get the job done. I usually recommend that new developers start with Python. It teaches structure and consistency without as much variation or room to screw up.

Tell people to code it in Java or C, preferably in vim.

Advantage: they'll never create a mess that you'll have to maintain.

/s

Yes, I totally agree with you: the advantage of PHP is that anyone can pick ut up, and they have done.

The question was often never if it should be coded in PHP or Java but if it should be coded at all and, if so: if it should be an excel file on a file share or sent in email or a php script.

Disclaimer: PHP and Java coder. I can get stuff done quickly in Java, but it takes some practice.

Re: PHP Sucks

#232
post #145

Earlier quoted context omitted.

I understand that the negative pressure can have a long term effect. Personally that has never gotten to me and it's sad for the author that they have been slowly worn down over time to a breaking point. I totally agree with "But, you should definitely learn more languages as a programmer." In my current position I led a ground up build in Python/Django after 10 years of personally using PHP. I learned so much that I…

If you're a PHP dev, you really ought to add a complementary language, not one that, like Python, is really quite similar when it comes down to it in terms of performance, execution model, language features, etc. There's a lot of good options out there and there's more coming every year now. Go is a nice choice because it really nicely complements PHP, being good at some things that PHP is bad at, and PHP being good…

Resume driven devlopment. As you say PHP and Django are similar in what you can use them for. I would choose either of the over Rust for a standard web app. Unless you have a specific need for concurrency, the PHP and Django are far more mature in the web app space.

Re: PHP Sucks

#233
post #221

Earlier quoted context omitted.

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…

"most of eBay's functionality" Do you realize what a ridiculous statement that is?

No. It's actually not hard. It was for an art reseller in Greenwich, CT, they held an art auction that was simultaneously online and in-the-flesh. I had account registrations, search (with image results), anonymous bidding, outbid notifications (via email), winning-bid notifications. I implemented the whole "what's the highest bid you would accept" functionality (also not hard). I did not write the frontend (a friend did that) and I didn't handle payments nor shipping (winners were expected to go to the physical store). Hence "ALMOST" all of eBay's functionality. :P

Either that, or I'm just a really good programmer under pressure (I pulled an all-nighter for that one), which I would not disagree with, I've basically been coding since I was 12 in 1984, so I would HOPE that I'm somewhat of a force to be reckoned with at this point. ;)

Re: PHP Sucks

#234
post #188

Earlier quoted context omitted.

I'll agree that what makes a good language is subjective, and that most all languages have their problems. There is a certain threshold where "good enough" is what matters. Personally, I'd rather everyone just stop the good/bad language debates entirely.

Programming has to be the only environment where the voices of academia don't seem to matter because "my language gets shit done". Deep inside, what do you think those researchers in the PL community, the people that know the ins and outs, that theorize about languages, the people who spent years and years learning about the theory behind it all, who created the OCamls, the Haskells, the Coqs, the Idrises and so fort…

> it doesn't offer a dramatically different or original model of thinking about programs.

In PHPs niche this should be in the advantages section.

Re: PHP Sucks

#235
post #188

Earlier quoted context omitted.

I'll agree that what makes a good language is subjective, and that most all languages have their problems. There is a certain threshold where "good enough" is what matters. Personally, I'd rather everyone just stop the good/bad language debates entirely.

Programming has to be the only environment where the voices of academia don't seem to matter because "my language gets shit done". Deep inside, what do you think those researchers in the PL community, the people that know the ins and outs, that theorize about languages, the people who spent years and years learning about the theory behind it all, who created the OCamls, the Haskells, the Coqs, the Idrises and so fort…

> Programming has to be the only environment where the voices of academia don't seem to matter because "my language gets shit done".

Wrong, otherwise we would have this discussion in Esperanto.

Sometimes Real Life (TM) experience beats clever design. PHP was first, has iterated, always had a niche and is now better than ever. Not good but good enough to save people a lot of work.

Re: PHP Sucks

#236
> A big part of this issue is that the barrier to entry in PHP is so damn low, almost everyone can start hacking wordpress templates. For many people, PHP is the first programming language they try without formal education.

This really hits the nail on the head. A lot of the criticism of PHP comes from people who have never worked with a good PHP codebase and have only seen some of the many examples of awful PHP code out there. A well written PHP codebase is really nice to work with.

> The problem I have with PHP has nothing to do with the language, it’s its reputation. I can’t count the times I’ve started a conversation with a programmer who upon finding out I primarily do PHP got awkward with me.

I've experienced this many times as well. I think the previous point is really the root cause of this. People have a lot of misinformed ideas about PHP due to the sheer amount of really low quality PHP code and "developers" (i.e. people with no experience just trying to get shit done).

Re: PHP Sucks

#237
I remember teaching myself PHP back in 2001 after the dotcom crash. I still use it occasionally to whip up quick sites on a shared server setup. I have also used to quickly build out some web based systems at my day job.

You can hate it as much as you like, but bad code comes from bad coding practices. PHP has all the features other languages have. It even fairs pretty well in the benchmarks game against its peers http://benchmarksgame.alioth.debian.org/

Re: PHP Sucks

#238

I left PHP for C# and JS. I've been burnt so many times from the tacky standard library it's not even funny. Coding php in a large application is both boring and hard. XDebug barely works and is hard to set up. Still, PHP is so goddamn cheap it's not even funny. But I recognize everything the author is describing.

Running C# (.NET Core) on DigitalOcean $5/month droplet too much for people?

How well does that price scale

Re: PHP Sucks

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

PHP, as a language, particularly since somewhere in the 5.x series, is basically "flawed, but still more than adequate." The real problem is that so many people who use it are utterly incompetent. When someone says they work in/with PHP you immediately wonder if they're in the "let's duplicate a 900-line function across dozens of files just to give various pages a different icon" camp, the "I call myself a PHP Develo…

[deleted]

Re: PHP Sucks

#240
post #57

Earlier quoted context omitted.

The thing is different languages lend themselves to different processes. Let's say you have the exact same bug in a web app, maybe you need to modify the where clause in the data layer of the app (or something small like that). In the C# version, you'll have to compile it and then push it. Maybe recycle the pool depending on factors in the architecture. In PHP, you just modify the file and throw it out there. Because…

> In PHP, you just modify the file and throw it out there. We've since learned that this is problematic.

Clearly not as problematic as the C# option.
Post reply on HN