Live data from Hacker News

We Don't Hate PHP

hologram.io

21–30 of 85 posts

Re: We Don't Hate PHP

#21
Is PHP still hated on a lot these days?

Isn't it just not that popular an option anymore to start new projects with? Most people are aware of the language having changed a lot since its heydays.

And honestly, from the article I'm not quite sure why I should consider using PHP. Sure, it has a lot of modern bells and whistles now that it didn't when I last used it 2005-ish, but what makes it stand out? I know a number of people that are super happy and productive with modern PHP, but those are all people that have been using it continuously since forever so it makes a lot of sense for them. But why switch to it from another stack?

E.g. the supposed best database integration of any language with "PHP Database Objects". At least the examples given are the absolute bare minimum I'd expect to get from such an integration. What makes it the best?

Re: We Don't Hate PHP

#22

The part on database access is not a plus for php. Writing sql like that is horrible, especially when it's simple. I'm in a huge refactor right now, where i'm utilizing postgres schemas and doing it with php, like in the article would be absolutely horrible.

You might like Medoo: https://medoo.in/

Re: We Don't Hate PHP

#23
I've been using PHP for years and am a believer. It's just as good, if not better in many cases, as other languages used for similar purpose. Especially with the features PHP 7 brings; I particularly like the more robust type hinting. Just gotta write good code!

Re: We Don't Hate PHP

#24
I recently had to work on a PHP codebase. It wasn't a very old one in terms of churn, but it had been around for a while. It was surprisingly clean and well-built from what I could tell, it just got lost in a transition to a new server in a new language. Symfony itself still has some warts in terms of boilerplate but it wasn't difficult to poke around the code. In fact, the most painful bit was setting up on a Mac because the extensions for IMAP and other things weren't easy to add in. That's more of an issue with Homebrew and their decision to reduce what they were willing to support.

Language wise, it's catching up a lot and the additions seem to be sensible enough. I'm not sure I would start a fresh project in it but it's great to see how it's matured over the years, and just like Typescript is to JS, I hope it provides a good introduction to things like static typing to novice programmers who are starting out with PHP for pure ease of use.

Beyond that, what's the point in hating a language? I've found real joy and enthusiasm in playing with different ones just to get a feel for how you would approach certain problems with them.

Re: We Don't Hate PHP

#25
post #21

Is PHP still hated on a lot these days? Isn't it just not that popular an option anymore to start new projects with? Most people are aware of the language having changed a lot since its heydays. And honestly, from the article I'm not quite sure why I should consider using PHP. Sure, it has a lot of modern bells and whistles now that it didn't when I last used it 2005-ish, but what makes it stand out? I know a number…

The more experience I get, the more I think that most languages are just fine. Coding is increasingly the easiest part of my job. I’d work in PHP if needed. But I’m still not touching MUMPS.

Re: We Don't Hate PHP

#26
post #21

Is PHP still hated on a lot these days? Isn't it just not that popular an option anymore to start new projects with? Most people are aware of the language having changed a lot since its heydays. And honestly, from the article I'm not quite sure why I should consider using PHP. Sure, it has a lot of modern bells and whistles now that it didn't when I last used it 2005-ish, but what makes it stand out? I know a number…

[deleted]

Re: We Don't Hate PHP

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

Re: We Don't Hate PHP

#28

Earlier quoted context omitted.

Go may not be the best language for your project, but what makes PHP better than the entire set of languages that aren't Go?

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/ecosystem.

To be clear: there's nothing wrong with your using PHP. I'm just left wondering what your initial point was... that PHP is your favorite language?

Re: We Don't Hate PHP

#29

Those all seem like features any modern programming language has. Nothing here particularly distinguishes PHP from the rest of the crowd. I don't think anyone is surprised by the fact that PHP has classes and some niche methods integrated in most standard libraries. I would like to go one further and say most other more modern programming languages do each of these better. It's always a good idea to look what is beyo…

Furthermore, many of these things were present in PHP 4 or 5 (the 'bad" PHP that many of us remember). PHP 4 already had classes [1]. PHP 5 had PDO.

[1]http://www.nusphere.com/kb/phpmanual/language.oop.htm

Re: We Don't Hate PHP

#30
I think a lot of people are confused at the lack of comparative statements here. As far as I can tell, every single benefit listed in this article also comes with, say, a Python/Django stack.
Post reply on HN