top | item 12708598

(no title)

ryanlm | 9 years ago

People that state it's such a horrible language are "follow" types. I believe some people actually do think it's a bad language, but for the most part, I would say people are just following the status quo.

discuss

order

nbouscal|9 years ago

I worked professionally in PHP for years, and have since worked professionally in Ruby and Haskell. I'm not following a status quo by saying that working in PHP was exceptionally painful by comparison even to Ruby (despite Ruby being quite painful by comparison to Haskell), and that I'll never work in PHP again. Maybe I'm in the minority, but I don't see any reason to think so.

spronkey|9 years ago

It is a horrible language. In the same way that hamburgers are horrible food. But they can be damn tasty regardless.

There are plenty of resources around that demonstrate just why it's so horrible. It's inconsistent, easy to shoot yourself in the foot (mainly because of the backwards compatible stuff), some stuff is just plain broken (ISO_8601 for example), yeesh.

But for many web projects - APIs, server-driven web applications, it can be a pretty solid choice.

It's main downsides are the ugliness of the language, shaky history for core commit code quality, and poor usability for long-lived processes. In 2016, these three issues can be worked around reasonably easily (though some danger does exist especially handing a codebase to inexperienced developers).

It's upsides are quite numerous. It's gradually typed, which means it can be used dynamically, but also supports more type-driven DDD-esque work, and codebases can mature over time by progressively adding more static analysis.

The execution environments now available are fast and reasonably efficient. In practice, PHP will beat out CPython and Ruby for most request-response type applications quite handily.

The wider PHP ecosystem is pretty OK. Composer and Packagist are on par with NPM/NuGet/RubyGems, and are easily better than what's available in the Python or Go ecosystems. The quality of packages varies, but in my experience it's on par with the rest - there are some shockers, but there's a lot of solid stuff too.

Unlike Python, it doesn't suffer from massive division - older PHP code can suck, sure, but much of it has been composerified and can be used easily with a bit of Facade or Mediator in newer projects.

PHP has deployment pretty well down, too. Mod_apache is super easy for basic uses. FPM works pretty well for more advanced stuff. It's easier to manage than the likes of the JVM, or even 12-factor type "bundle into an executable and reverse proxy" apps. But you can also do that with PHP as well, if you want to.

Is it my first choice in development environment? Absolutely not. Is it a very effective tool for many applications in 2016? Absolutely. Do I pick it up over Python and Ruby if I'm looking to build a web application? Yes I do.

TazeTSchnitzel|9 years ago

I've contributed to the PHP codebase for 3 years, and I think it's bad.

NormlOverrated|9 years ago

Hello Andrea... May I ask a question?

You're quite critical of PHP, and often claim it's bad and flawed. And yet you're a core contributor, are you not?

Well... what are your suggestions? What would you do? What's the future of the language? Should people bail or not?

Ysx|9 years ago

I have a differing opinion, and similarly have no way to back it up.

wnevets|9 years ago

The hive mind is very strong on the internet, even on HN.

ryanlm|9 years ago

It's a wasp stronghold.