Hacker News new | ask | show | jobs
by koen_hendriks 2477 days ago
"every PHP programmer is bad at programming, the language is designed to accommodate them with convenient footguns (or faceguns) at every step, and the ecosystem is accordingly bad. No, PHP7 doesn’t fix this. Use a real programming language, jerk."

This guy seems like a real open minded person who did his research and shared his opinion after making strong points. /s

3 comments

PHP unique pros:

  - Cheap (almost every cheap/free hosting supports it without any extra config)
  - Easy (can other languages beat this out of the box: `$_POST["name"]` ?)
  - Wordpress
PHP things that are not unique but good:

  - Huge market (if you are into bootstrapping your business, there are lots of opportunities and low hanging fruit in PHP)
  - Lots of big open source projects to customize or work on top of (nextcloud, etc...)
Things that you need in order to appreciate PHP:

  - Have a product mindset
I'm still a bit surprised nobody ever used PHP as a target (think clojure/jvm, or whatever/js).

There's https://github.com/Scriptor/pharen though

yep, stopped reading after this. How can this be objective if you think that everyone is a "bad" programmer that uses this or that language, wtf.

Pros for PHP could be, it's templating capabilities with HTML, easy to use DB interfaces and the entanglement with the web/HTML/web-server in general. Nowadays you don't really write these kinds of apps anymore where your backend returns whole HTML Pages but that doesn't mean it's a bad language.

> How can this be objective if you think that everyone is a "bad" programmer that uses this or that language, wtf.

I get the feeling the author is either not trying to be objective, or is one of those people who confuses strident opinion for objective fact. "PHP is bad and everyone who uses it is bad" is a meme that some people take seriously... and one that also applied to javascript until Node.js appeared and it became valuable, interestingly enough.

I would say there are no objectively bad languages, just bad code (which can be written in any language), or languages which aren't used in an optimal way, since every one was created with a specific frame of mind and intended use case. PHP serves its purpose, and if someone doesn't want to use it, they can just not use it. Obviously PHP has pros, if it didn't, no one would use it.

Same. Also I'd add low entry barrier and maturity of interpreter.

Of course, this comes at a price. But saying PHP has no pros is quite subjective

Calling it “subjective” is being pretty nice. It’s just an obviously incorrect statement.
Tell it to companies such as Zalando (they started with PHP), Facebook, Magento and so on.
Facebook started with PHP - but quickly replaced the standard library, the interpreter, and then eventually the language itself (Hack still looks kind-of-like PHP, but is no longer compatible)

(Working with both vanilla PHP and Hack; I find the latter orders of magnitude nicer to work with - just for XHP alone, I wish I could switch my PHP projects to be Hack projects...)