Live data from Hacker News

PHP Sucks

evertpot.com

61–70 of 297 posts

Re: PHP Sucks

#61

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?

Well true, but .NET Core isn't released stable yet?

Re: PHP Sucks

#62

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…

I used to like Laravel, but lately it feels so enterprisy. There is a lot of boilerplate in Laravel today and it was changing too fast for me to keep up with it.

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)

Re: PHP Sucks

#63
post #57

Earlier quoted context omitted.

That sounds like more a company/environment issue than an issue with either language.

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…

We're constantly building and deploying as a c# shop. Most of it's automated with canary testing servers.

Re: PHP Sucks

#64
I'm by no means an expert on PHP but whenever I begin having similar thoughts like the author, or begin having internal language religion wars in my head about PHP, i remember that PHP actually stands for "PHast Prototyper" (language/platform)..and tools/platforms like that have their place in the world to help us...and then this thought allows me to regain my peace and progress forward on my day (focusing on bigger things). This does not mean PHP is inherently good or bad, merely a tool; to be used under the right conditions (in this case rapid dev.).

Perhaps remembering that PHP could mean "PHast Prototyper" could help you/your team come to terms with all this?

Re: PHP Sucks

#65
post #8

I used to feel the same way a lot of times, a shame it seems for being a PHP dev. Now, I don't care. I've been using it since 1999, and I use it to get stuff done. My customers and users of my applications don't care what it's written in. But, you should definitely learn more languages as a programmer. > And to anyone considering programming as a career, or trying to get into it... stay away from PHP. This is the par…

Unfortunately, the issues aren't with "new" PHP, it's with the mountains of "old" PHP code that invariably finds its way into your project. Also, having had to maintain a Wordpress site the past few months, may God have mercy on all daily Wordpress devs. I truly admire your stalwartness now in putting up with that.

The problem is that clients really want WP a lot. Bigger and bigger companies currently and for most of their departmental sites. This is WP shoe-horned in a full site CMS function. The thing is, users seem to love it. I would wager that if you just rip out the guts of PHP and leave only the frontend (the /wp-admin part that is), but leave it 100% as it is and write a solid backend in Django/Rails, you have a winner. The problem is that when people attempt this, their own 'taste' comes in and it always ends up being a vastly different frontend which then users don't want as it's not 'the same as WP'.

Before anyone says it; sure some users use WP for the themes and plugins; we use some of them but we are very careful using plugins. They have to be rocksolid for many years, actively supported and we have to have reviewed the code. Next to that they have to add something significant; installing a plugin for some social buttons is very much not worth the pain of updates / security breaches on a 100k+ (+ SLA) project. And so in the end we end up using 4-5 the same plugins for projects and the rest is either not needed or easy to implement anyway. So the hero implementing those guts in Django/Rails could also implement those plugins. I believe you would have something safe for the enterprise. Until then, they'll just use WP and trust admins/coders to fix the issues.

Re: PHP Sucks

#66
"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."

The HN post title is sure helping with the reputation.

Re: PHP Sucks

#67
It's not about a language or a technology, it's about what you do or can do with it...

All trendy technologies might be replaced anytime (hey React, Go, I'm looking at you!), one day they are very cool, the next day nobody maintains them and everyone talks about another new cool thing; how many of these have we seen?

New cool stuff are important to know, explore, test, use because they bring a lot of interesting stuff, but often they only address some use cases, as they have been made by a team with specific needs (looking at all hundreds NoSQL databases?); php and some others (like ruby) are stable, well known, cover a vast area of use cases with very well made and long thought frameworks and tools (symfony, doctrine, phpstorm, ...).

You are always free to follow trends, like with clothes, or just choose the best thing for what you need to do. You'll definitely find jobs with any of these, if you are able to explain why they are good for what you are doing.

Re: PHP Sucks

#68

Can we just stop with these posts? It's like saying "ice cream sucks". That's just like, your opinion man.

> That's just like, your opinion man.

I don't think you can argue it's just an opinion. I haven't seen anyone argue that php isn't badly designed or implemented. Other than stating that it works and you can work around it.

Re: PHP Sucks

#69

Earlier quoted context omitted.

If you're doing it as a job, though, you probably end up having to work on a lot of legacy codebases with the old issues.

That, and I've noticed that the typical legacy PHP codebase is worse than the legacy codebase in other stacks.

It is far worse I would say. Legacy PHP code is some of the worst code I have seen in my life. Everyone with HTML/JS knowledge could also do PHP and they did. There are many production systems (banks, insurance etc included) running old style php with html mixed with php mixed with JS. And it runs fine, but if you need to fix something that broke or had to be changed...

Re: PHP Sucks

#70

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?

PHP is also cheap to write (in theory; the programmers are cheaper).
Post reply on HN