Live data from Hacker News

PHP Sucks

evertpot.com

141–150 of 297 posts

Re: PHP Sucks

#141
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 graduated in 2003. I haven't been able to stop coding php. Why? Because of the amount of work . I know other languages, but the pay for php these days is totally astronomical. (I live in sf, pacific-heights / WELLL over 6 figs / wife doesn't work). Currently I feel like I have a massive technical advantage (I wont share). Right now I work on iphone/android backends - at massive scale, top 10 (PHP is fast). When peo…

I've mostly tried to fight the anti-PHP movement because I WANT new developers to come on board and create great things. I want new packages to pop-up as soon as some new tool/api/widget becomes available.

I've felt for quite some time that most of the anti-PHP sentiment is an effort of other developers to justify the language they've selected to focus on. "Yeah, I'm doing Javascript and Node.js and yeah it's got it's sharp edges, but at least it's not PHP!"

The problem is, if the negativity continues, the next step is that business WONT want PHP in their ecosystem... And not because it can't get the job done for them, but just because "ew PHP. I heard that was bad."

Re: PHP Sucks

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

| More often it's the programmer who sucks, not the language. Whilst it is possible to write structured, elegant php, its very hard, and thats the languages fault. The barrier to entry to write bad PHP is very low, thats what makes people think it 'sucks', because 90% of PHP codebases do. :(

It's not hard to write structured elegant php, that is horseshit. Please look at code for symfony or laravel. Hell, my annoyance with writing good code in PHP is that it ends up looking like Java, which begs the question, why not just do it in java.

https://github.com/symfony/symfony/tree/master/src/Symfony

or you can look at simpler sample codes I wrote for a class in design patterns with php

https://github.com/segmond/phpThingz

Re: PHP Sucks

#143
post #117

Earlier quoted context omitted.

| More often it's the programmer who sucks, not the language. Whilst it is possible to write structured, elegant php, its very hard, and thats the languages fault. The barrier to entry to write bad PHP is very low, thats what makes people think it 'sucks', because 90% of PHP codebases do. :(

I disagree. Namespaces help hugely, as do Traits, etc. It used to be difficult back in the pre 5.4 days, but we have come a long way since then. Older projects will suffer till they're brought up to spec, true.

In which ways do Traits of all things help write good, disciplined code bases?

I think traits, and their Java equivalent, are OK to touch up legacy APIs (as they did with the Java collections API) but I have found no good place to stick them in a new project.

Not to say PHP hasn't been introducing functionality for writing good, stable code bases (type hinting in function signatures, namespaces, better garbage collection, an actual AST — as an aside: how ON EARTH did they do without an AST pre-PHP7?) but traits don't strike me as the feature to think of when designing a new code base.

They're not extendable, they're not overridable, they're monolithic, and classes expose their implementation details to them, which makes traits super fragile.

Re: PHP Sucks

#144
With a decent IDE like phpstorm, modern PHP is surprisingly pleasant to program. I would never use Java/C# again if it's up to me.

Re: PHP Sucks

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

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 at some things Go is bad at. Rust might be a good choice with just a bit more web dev work on it. Erlang/Elixir, Clojure, something with a great concurrency story, an easier time getting to high performance, and some (good) static typing for when you're in the code where that's a good idea, that sort of thing. PHP->Python is not a bad thing necessarily, but it's not really "diversifying" very much.

Re: PHP Sucks

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

"old" PHP code should not be finding it's way into your project. Use a facade, adapter, proxy or bridge pattern to decouple your new shiny awesome code from the legacy cruft.

Re: PHP Sucks

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

[deleted]

Re: PHP Sucks

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

>> More often it's the programmer who sucks, not the language. Or the client sucks.

Nah, the client might not know how to explain what they want, but that's okay. Plenty of people go to the hospital and can't explain what is wrong with them. It's your job as a professional to extract what the client wants, just as it's a doctor's job to perform correct diagnosis and not blame you for poorly explaining your symptoms.

Re: PHP Sucks

#149
post #60
post #7

I hate PHP too, but I write it almost every day at work. There's something to be said for how stable it is. I spent a large amount of my career doing .net development and deployed very rarely. It was a big day when I deployed. I would say to my wife, probably going to late tonight, we're deploying. Because something always went wrong when deploying. Here, I deploy every other morning. Usually, while my coffee is gett…

We deploy constantly as a .net shop. Octopus deploy is probably one best pieces of software I've used for deployment. It's a company issue.

Same. It took us awhile at our company to wrap Octopus around our existing workflow (we don't do some things the way Octopus expects, but over time I found workarounds), but once a project gets set up, it's so super easy and just works, so much so that it's made deployment fast and predictable.

Once we switched over to Octopus we no longer had to bring several people on the team in and expect them to work 6+ hours on the weekend to do a deploy anymore, catch mistakes made during the deploy, etc. Now it's just done with a netops team clicking 'start' for each project, my boss on standby, and the whole thing done in about an hour, usually.

Re: PHP Sucks

#150

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…

The thing that hurts PHP is also the very thing that makes it popular and creates the demand. it's easier to build things with it. It's damn near the BASIC of backend programming.
Post reply on HN