Live data from Hacker News

We Don't Hate PHP

hologram.io

31–40 of 85 posts

Re: We Don't Hate PHP

#31
post #11

Laravel is the only reason I'm using PHP but it's a good one. Hands down the best framework I've ever used in any language.

What makes Laravel so good and why can't we clone to a framework in say Python?

Laravel benefits substantially, IMO, from a "benevolent dictatorship" contributor model that targets "is this easy to work with" over pretty much anything else. Taylor Otwell can be a controversial figure in the PHP world at times, but the results are difficult to argue with.

Re: We Don't Hate PHP

#32

Earlier quoted context omitted.

The two best reasons are these: 1. The Laravel ecosystem. 2. I have over ten years of PHP experience.

Using PHP sounds like a perfectly sensible choice, given your circumstances. Your argument falls short of convincing that PHP is the best tool for _everyone_, though. 1. I'm not aware of any non-trivial feature in Laravel that isn't matched by e.g. Rails, Django, Elixir, or indeed any sufficiently modern web framework. 2. This speaks more to where your comfort zone resides than any intrinsic merit of the language/eco…

I'll grant both of those points, with the caveat that I wasn't trying to say that PHP is the best choice for anyone to solve my project's problem set, but rather the best choice for me.

Re: We Don't Hate PHP

#33
post #16

> PHP isn't the outdated, clunky language you may think it is. Proceeds to give a long list of outdated and clunky examples that look like a joke next to any modern framework.

Which modern framework? The most common alternative: python. A 30 year old language with two completely different syntactical versions 2 & 3. Packed with all the great shit fest, eg: urllib, urllib2, urllib3.

Python isn't a framework, but in contrast to Pythom, PHP made some bad decisions that are hard to roll back, the biggest being cramming hundreds of inconsistently named standard library functions into the default namespace. PHP can be very productive but I think it's fair to day it was designed a lot less intentionally than many languages.

Re: We Don't Hate PHP

#34
PHP has been on-par with Ruby and Python for a long time now. There's no reason to hate it, but also not a lot of reason to use it (or Ruby), since I think Python really has the mindshare now.

Re: We Don't Hate PHP

#35
This is such a surface-level article. Most of the things listed as advantages exist in other languages as well.

Here are some actual reasons to like PHP:

1. Java-like interfaces and classes and strict argument (and soon parameter) typing enforced at runtime

2. Autoloading and "lazy loading" of classes means defining bi-directional relationships between classes/types is painless (this can of course also make you shoot yourself in the foot, but I prefer that to dealing with circular imports in Python for example)

3. The deployment model is dead simple on a VM (with drawbacks, but by the time you need things like atomic deployments you've probably moved to containers anyway)

4. Statelessness

5. Performance (despite the statelessness!)

6. A very healthy package ecosystem, with several cross-framework interoperability projects

It has lots of bad parts as well, of course, but so does every language. And you may disagree with some of the things I listed if you don't like the particular feature or design, but that doesn't make them not advantages.

Re: We Don't Hate PHP

#36

One advantage of PHP over Node or Java is that it is stateless, so no worrying about memory leaks. And most disadvantages of this disappear when scaling out.

I mean, you generally want node to be stateless too. the DB should be your state.

Re: We Don't Hate PHP

#37
I don’t hate PHP either. I just want to be able to get another job doing something interesting after I spend 18 months at your company.

Otherwise I’ll be stuck in the public sector maintaining broken Deloitte unemployment portals, making 1/3rd of what junior coding academy developers make.

Easy calculus.

Re: We Don't Hate PHP

#38
Whatever irritations I may have with current PHP-the-language (my biggest one is it's too easy to make string handling mistakes) are dwarfed by my irritations with that decrepit but incredibly popular PHP behemoth, WordPress.

The spirit of early-days security-ignorant PHP lives on in WordPress, where proper security is basically impossible. You'll never be confident that you've found all the back doors after an incident.

Re: We Don't Hate PHP

#39
I still prefer using PHP than Java or something else when it comes to write proof of concepts.

Nothing can beat features like hot reloading, fast debugging, get things done in a matter of few hours.

Re: We Don't Hate PHP

#40

People who hate PHP-- or even worse, hate other people for writing PHP-- generally don't have anything of value to add to the criticisms of PHP. They just dismiss the language entirely, link to 2012-era blog posts about its imperfections, and never bother to see if anything was fixed in PHP 7 (or, as of the end of this year, PHP 8). This kind of toxic mentality doesn't produce better code, and it sure doesn't produce…

I think it's fair to say that PHP was okay, historically, but with hindsight, I wish I would have moved on sooner. I made a lot of money on PHP code. But then realized there were other languages that I could also make money on, that worked better for what I needed. But would I go back? No..

What did you switch to out of curiosity?
Post reply on HN