7 ms·
He works on Go at Google. A skilled professional no doubt, could he not have made some valid points rather than simply calling PHP disgusting. It didn't add a
by xd 13y ago
He works on Go at Google. A skilled professional no doubt, could he not have made some valid points rather than simply calling PHP disgusting. It didn't add anything to the conversation.
If you where in the pub and someone spent some time listing the virtues of the pint they where drinking, and then someone joined in the conversation and called it disgusting with no basis .. wouldn't you find that to be odd behavior?
- grey-area 13y agoHe probably didn't elaborate because he felt the basis for the view was clear - there are clearly areas of PHP which still need work. PHP is often frowned upon because the APIs are a mess of legacy cruft like addslashes, magic_quotes, mysql_escape_string, mysql_real_escape_string, mysqli_real_escape_string versus prepared statements. Efforts are being made to clean it up, but for a language to ever end up in a place with that sort of library functions is a pretty big red flag.
- xd 13y agoCheck the manual; magic_quotes, mysql_escape_string and mysql_real_escape_string have already been deprecated/removed.
- grey-area 13y agoI'm aware of that thanks, as noted in the last line: Efforts are being made to clean it up, but for a language to ever end up in a place with that sort of library functions is a pretty big red flag.
- xd 13y ago"for a language to ever end up in a place with that sort of library functions is a pretty big red flag." At the time it was reasonable .. but PHP evolved and learned lessons, it didn't just stop there as you seem to be saying.
- cowsandmilk 13y agomysql_escape_string [1] mysql_real_escape_string [2] Why is exposing a C library's functions and their names PHP's fault? [1] http://dev.mysql.com/doc/refman/5.5/en/mysql-escape-string.html http://dev.mysql.com/doc/refman/5.5/en/mysql-escape-string.h... [2] http://dev.mysql.com/doc/refman/5.5/en/mysql-real-escape-string.html http://dev.mysql.com/doc/refman/5.5/en/mysql-real-escape-str...
- Joeri 13y agoBecause php ends up combining the API consistency of C with the syntactic elegance of visual basic. I say this as someone who programs php professionally, the fact that they still haven't provided a complete set of OO api's very much speaks against the language stewards. PHP could have a sane subset, like javascript, but because there are gaps in the API (like the string and array API's, which are horrible) you can't get a sane subset without adding some extra API wrappers of your own. And that's why it's impossible to build frameworkless PHP code that is elegant, something that even the designed-in-10-days javascript lets you do. Still, i like php for its getting things done mentality. What it lacks in elegance it makes up for in productivity.
- zxcdw 13y agoHe did explain why PHP is disgusting mess. And hell, the fact that people have that opinion stems from somewhere. And that is a fact we should all take a note of -- to build better tools. You see, PHP is nothing but a tool, and as a tool, it's not very liked one due to it's flaws. Solution? Abandon it! Build new, better tools instead of feeling threathened. Le PHP sink and die it's well deserved death and make way for better tools, because professionals shouldn't feel attached to their tools, instead they should be critical towards them and look to find better ones.
- xd 13y ago"haphazardly accumulated features" is not an explanation, it's a subjective point of view. "it's not very liked one due to it's flaws", PHP is very well liked, just not by everyone .. which goes for most things in life.
- josteink 13y ago"haphazardly accumulated features" is not an explanation, it's a subjective point of view. If you really need it, here's a very good write-up which should cover that in an impressively detailed manner: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- xd 13y agoThis was hotly debated, by myself included, right here on HN: https://news.ycombinator.com/item?id=3820431 https://news.ycombinator.com/item?id=3820431 He has updated the article over time which is good of him, but much of it is still subjective and from a quick glance there are points that no longer hold true.
- Tegran 13y agoHere's one rebuttal to that: http://forums.devshed.com/php-development-5/php-is-a-fractal-of-bad-design-hardly-929746.html http://forums.devshed.com/php-development-5/php-is-a-fractal...
- ben0x539 13y agoDo you really want another thread in which everybody enumerates their favorite issues with php?
- icebraining 13y agoEven if he hadn't explained why, and he did, it still wouldn't be elitist.
- enneff 13y agoSorry if I upset you. Your feature list is no stronger a point than my response, though. Features don't make a language great. Clarity, consistency, simplicity, and orthogonality do. PHP has none of those qualities. I know, because I used it extensively for a decade. I stand by my comment. I can see why people like PHP but nobody in their right mind should deny that it is a mess and that it was constructed haphazardly.