Live data from Hacker News

We Don't Hate PHP

hologram.io

61–70 of 85 posts

Re: We Don't Hate PHP

#61
post #44
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…

We have a government customer with PHP in their list of technologies that we are prohibited from employing in service of their contract. I thought it was kind of random to single out something that we never intend to use, but in their minds PHP is right up there with Flash as a pariah of the web. So yeah, there are some people out there who really really hate PHP.

Oh wow, when working with government and enterprises I only ever saw list of technologies explicitly allowed, never prohibited.

Re: We Don't Hate PHP

#62
post #13

Sorry guys,PHP is the outdated! (From someone who start PHP in 2000 with PHP 2.0 and is still reading lastest Laravel code source). To young people: choose your language wisely, you don't need to know PHP to be successful in Web dev

The top open-source ecommerce platforms (magento, woocommerce, etc) and content management systems (wordpress) are all in PHP, and yes they were written before 2000. You don't need to know PHP to be a successful web dev if you are working at a silicon valley tech / social media company, but e-com and content management are still what most companies are trying to do on the internet, and if you are interested in a tech…

That's certainly true, but we're living in a funny time, everything has evolved so quickly that there are 15yr old PHP apps rubbing shoulders with 7yr old Rails apps next to 4yr old Node apps and now React etc. Some of that represents actual progress, some fashion, but for all those legacy apps, someone has to keep the lights on (until the plug gets pulled). That said, I don't really miss PHP too much, it was much nicer than Perl for adding a little magic to html, but building anything big was not fun (I gather Laravel makes that better these days, but there are a lot of other choices if you're starting fresh).

Re: We Don't Hate PHP

#63
post #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 be…

The PHP IMAP extension is a bit of a sore spot. It's an interface to a C library (https://github.com/uw-imap/imap) which has been effectively abandoned for the last >10 years. There's been some off-and-on discussion about unbundling the extension from PHP or dropping it entirely.

Re: We Don't Hate PHP

#64
post #52

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…

Hey, really good list, better than the article. I don't really like PHP, because of inconsistency (it tends to break to flow for me) (but maybe it changed since 2014), but php with strict typing is a big plus for me and php7 is already more than fast enough. I might try it again. The real issue i have with PHP is frameworks :/ Too much choice is a productivity killer for me.

I'd really love if we could just start over with the PHP base library design. There's just a lot of cruft that could be neatly packed into classes.

For instance, the arguments for array_map and array_reduce are reversed, one takes the function as first argument, one the array.

Re: We Don't Hate PHP

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

Saying that Python 2 & 3 use a completely different syntax is a pretty gross overstatement.

Re: We Don't Hate PHP

#66

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.

This comment is so true it hurts to read. Same can almost be said for other languages I actually _do_ like (perl, clojure.. sure there's _some_ jobs but the market just isn't the same as many others)

Source: left php about a decade ago and I'm not looking back

Re: We Don't Hate PHP

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

Sure, Django/Python is a plenty good example. Python manages to be older than most of its competitors while still feeling like its cutting edge. Django is hard to beat in all but speed. What about newer stuff like Elixir/Phoenix, or even Node/Express or Ruby/Rails.

That said, I'm not even saying PHP is bad, but this article doesn't convince me why I'd pick PHP over literally anything else.

Re: We Don't Hate PHP

#68
post #33

Earlier quoted context omitted.

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.

PHP is very guilty of cramming hundreds of inconsistently named standard library functions into the default namespace, but I wasn't aware of Python doing this?

Re: We Don't Hate PHP

#69
post #52

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…

Hey, really good list, better than the article. I don't really like PHP, because of inconsistency (it tends to break to flow for me) (but maybe it changed since 2014), but php with strict typing is a big plus for me and php7 is already more than fast enough. I might try it again. The real issue i have with PHP is frameworks :/ Too much choice is a productivity killer for me.

Symfony

Re: We Don't Hate PHP

#70
post #41
post #29

Earlier quoted context omitted.

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

Exactly. I’d argue what makes modern PHP less awful is almost entirely in what it lacks . Checking a bunch of random OOP boxes is not going to make it a good language. People love plenty of programming languages that don’t check those boxes. (Lua, C, Go are all languages that lack many of those OOP features, for example.) And to be sure, modern PHP is better. The beginnings of typing, the fixing of horrible standard…

> And it’s tricky to dockerize a PHP app effectively since you typically need multiple processes;

Absolutely. I handle a lot of the devops work at my job and PHP containers are just all around more annoying to build, configure and run than most other languages. Even on modern frameworks like Laravel still have a lot of default assumptions of being hosted on a server all by themselves.

It's weird how a language that gained so much traction for being the easy language to host has become one of the harder ones to deploy in the modern era.

Post reply on HN