Hacker News new | past | comments | ask | show | jobs | submit login

A thoughtful critique of PHP. Good. Here's the thing, for those of us who use PHP on a daily basis, we are all well aware of all of this.

I have almost 100K lines of PHP code and only one of them spits out HTML. That would be the line that fetches the initial HTML template which is static and spits it out. After that, everything is XHR and web sockets. The DOM is manipulated directly by client-side JavaScript.

Why use PHP? Libraries to use any database I can imagine. Existing libraries for any API I can imagine. Language maturity. Familiarity and similarity to C.

I know the mines and I stay away. On top of that, those maintaining the language are aware of them too and they are slowly deprecating them.

> PHP is a supposedly dynamic language, but it almost goes out of its way to make manipulating complex data structures difficult.

Why would you use complex data structures in PHP? If you did, why try to manipulate them?

PHP is a language that is made for the web. On the web, anything that is computation heavy, like data manipulation, should be done on the client's side. Not that JavaScript is much better at data structures and manipulation, but at least it probably has a monster of a CPU and a boatload of RAM to smooth things over.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: