Live data from Hacker News

We Don't Hate PHP

hologram.io

81–85 of 85 posts

Re: We Don't Hate PHP

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

Laravel or Symfony. Laravel is far better for actually getting things to production quickly IMO. It's quite batteries-included but still lets you roll your own paradigms where you need to.

Re: We Don't Hate PHP

#82

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.

As I understand you have probably never used python or ruby ;) ?

yes indeed, but you can find cheap PHP hosting, while for python or ruby it requires more steps

Re: We Don't Hate PHP

#83
post #54

The autoloader feature sounds interesting. I've always wondered why there is so much ceremony around importing modules when it seems like the compiler could figure it out in many cases (e.g. when you follow the Go-like style of having module names at the call site). For example every Java file seems to start with entire screenfuls of imports. I've never seen that in any other language. Though I'm sure there are a lot…

I don't see the appeal in omitting that ceremony. Modern IDEs do it for you. On the other hand, a reader of the code must not replicate the work the autoloader does. If there is a class named Database from the backend module. The concrete class referenced there is highly dependent on the environment, the autoloader has at runtime. For me, this seems to be a source of many non reproducable bugs.

Re: We Don't Hate PHP

#84
post #52

Earlier quoted context omitted.

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.

AFAIK, PHP 8 will support named arguments. I think that will make it easier to call built-in function without knowing the correct order of its arguments.

Re: We Don't Hate PHP

#85
Many comments here complaint that this article doesn't convince them to use PHP. Well, I think that is not the purpose of this article either. In my opinion, it only lists some feature of PHP to show that actually PHP as a language an ecosystem also has the feature other considered modern languages have.
Post reply on HN