News for hackers. Stuff that matters.
Re:PHP: the quiet powerhouse by Killswitch on Wednesday June 13, 2012 @07:03PM (#4108944)
Here's an idea.. If PHP is so bad.. Don't use it. Simple as that. Let the people who want to use it... There's absolutely very minimal things wrong with the language. Everyone's quick to compare it with Python or Rails or something else saying "PHP does this wrong that Python does right" well, if PHP did everything the same way as Python, Rails, or something else, when what makes it different? Who wants to use a language that doesn't have some severe difference?

It's annoying seeing people waste their breath on arguing why PHP is so bad... Especially when many people/companies have proven PHP is good and can be scaled and used on high trafficked sites, yet 90% of the arguments are how it doesn't scale.

Just because you have used Wordpress or built a quit todo app in PHP that took you 5 minutes and that's the extent of your usage with the language, doesn't make OR break the language.

Quit complaining and let PHP users use PHP, and you continue using whatever the language you use is.

Signed, A Python, PHP, and Node.js developer.

Re:PHP: the quiet powerhouse by ralph on Wednesday June 13, 2012 @07:13PM (#4108978)
PHP has all the beauty of Perl with none of the power.

I think part of the reason folks pillory PHP is their annoyance that people are using it as their first language and may never move beyond it to the better alternatives available.

Re:PHP: the quiet powerhouse by getsat on Wednesday June 13, 2012 @07:55PM (#4109113)
> There's absolutely very minimal things wrong with the language.

I guess you missed this post that highlights a few of them: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...

I agree on using what you enjoy using, but implying PHP isn't riddled with flaws is absurd.

Re:PHP: the quiet powerhouse by corford on Wednesday June 13, 2012 @08:45PM (#4109256)
I guess you may have missed the accompanying HN thread (http://news.ycombinator.com/item?id=3820431) where quite a few of the article's claims were challenged/rebuffed.
Re:PHP: the quiet powerhouse by Killswitch on Wednesday June 13, 2012 @08:16PM (#4109172)
Just like Python, Perl, Rails, Node.js, and any other language out there. Why all the hate towards PHP?
Re:PHP: the quiet powerhouse by djur on Wednesday June 13, 2012 @08:47PM (#4109264)
"Rails" isn't a language, and PHP has fundamental design flaws that those other languages don't have. It's not that it has flaws, it's that it has unavoidable flaws.
Re:PHP: the quiet powerhouse by Mikushi on Thursday June 14, 2012 @08:40AM (#4111012)
It's something I find interesting. PHP "haters" keep pointing at flaws, yet in almost 10years of doing PHP, the only thing that really ever annoyed me is the string and array parameters order...

And I've done a wide range of thing in PHP, including scaling websites to millions of pageviews per day.

PHP might have design flaw, but in the end, they don't matter because they actually don't affect the day to day developer.

And I've tried my hands at Ruby, Python (still use it but more for scripting than web dev), C# (was actually my first language for webdev), and weirdly enough I find that they get in the way more that PHP does when it comes to building websites.

Re:PHP: the quiet powerhouse by ericingram on Thursday June 14, 2012 @05:31PM (#4113603)
This is how I feel too. PHP to me has been ideal for getting things done, but I suppose those who harshly criticize it are concerned with some obscure purity that has less to do with getting things done than style preference.
Re:PHP: the quiet powerhouse by Killswitch on Thursday June 14, 2012 @09:57AM (#4111343)
Exactly, most PHP "haters" are bitching about personal preference and not anything that in the end, makes a difference.
Re:PHP: the quiet powerhouse by Killswitch on Thursday June 14, 2012 @12:12AM (#4109729)
Every language has flaws, may not be the same, but they still do... I am sure I can go dig up enough flaws in Python to write an article totalling 960 words on why it's so crappy too... But I am not, because it's dumb to nit pick at one language just because YOU don't like to use it.
Re:PHP: the quiet powerhouse by andolanra on Wednesday June 13, 2012 @08:35PM (#4109230)
Some of the problems with PHP are things that are problematic or irritating to development (e.g. its inconsistent standard library) but other things are actively dangerous to security and correctness. For example, in PHP, '9223372036854775807' == '9223372036854775808' returns true.[1] Now imagine those two strings are hashed passwords.

The overall problem is not with specific flaws of PHP; the problem is that flaws in a language lead to errors in programs written with that language, and when that languages is used to write some kind of web infrastructure, then use of that language by people less than experts (i.e. almost everyone) is harmful to the whole internet. PHP can be used to write useful, scalable, secure web apps in the hands of someone who knows what they're doing, but in the hands of someone who doesn't quite know what they're doing, or who does but is tired enough to miss individual details of their code, it is much more dangerous than other comparable languages.

That is why I discourage the use of PHP if possible.

[1]: https://bugs.php.net/bug.php?id=54547 (Both strings appear numeric, so they are casted to numbers before the comparison, but because they are larger than maxint, they are rounded down. The solution, if you really must use PHP, is to use === instead. The fact that a solution exists does not mitigate my concern.)

Re:PHP: the quiet powerhouse by lucperkins on Wednesday June 13, 2012 @09:21PM (#4109332)
Agreed on what you said about writing scalable, secure web apps. No question about it.

But I should say as an aside (and you wouldn't necessarily disagree, I don't think) that these kinds of problems are not exclusive to PHP. JavaScript gets you exactly the same result. And try doing something as simple as 0.2 + 0.1 in JavaScript. Oy vey...

Re:PHP: the quiet powerhouse by Killswitch on Thursday June 14, 2012 @12:10AM (#4109727)
Blame the developer not the language...
Re:PHP: the quiet powerhouse by phibit on Thursday June 14, 2012 @01:43AM (#4109994)
php > var_dump('9223372036854775807' == '9223372036854775808'); bool(true)

This made me cry.

Re:PHP: the quiet powerhouse by Killswitch on Thursday June 14, 2012 @08:36AM (#4110990)
Because in a real application people are checking to see if those lazily match every 3 to 4 lines... Half of this stuff that makes the haters "cry" is unrealistically used things.
Re:PHP: the quiet powerhouse by lucperkins on Wednesday June 13, 2012 @07:05PM (#4108948)
Nice to see PHP get some love from polyglots!
Re:PHP: the quiet powerhouse by Killswitch on Wednesday June 13, 2012 @07:07PM (#4108953)
Thanks, I am also an App/PHPfog user too. ;)
Re:PHP: the quiet powerhouse by lucperkins on Wednesday June 13, 2012 @07:57PM (#4109118)
Then double freaking high five :)