News for hackers. Stuff that matters.
Re:I Like PHP by eropple on Wednesday August 10, 2011 @03:05PM (#2869691)
This is unfortunately true. I'm a PHP programmer (currently writing a book, A Highly Negative Book About PHP, that I've been billing as "like Essential Java but tells you what not to do") and, I like to think, a fairly good one; reading this article made me cringe because this guy is emblematic of most of the problems in the PHP community. He:

-accepts uncritically gobs of code dredged up via Google

-considers something "robust" if it doesn't break old code, when the rest of us hate it because we have to live with register_globals and other horrors

-considers "universal support" of craptastic versions of mod_php to be a good thing (some, but not all, major shared hosting messes use FastCGI)

-modifies files in production and thinks that's okay

It makes those of us who do know what we're doing and focus on disciplined code look bad, because the article author is what most people think of when talking about "PHP programmers".

Re:I Like PHP by mtogo on Wednesday August 10, 2011 @03:38PM (#2869834)
I'm convinced that this post is satire and the author has trolled us all.

In fact, i reject any other explaination. Sticks fingers in ears. Lalalalala, it's satire, nobody is this incompetent. Lalalalala, can't hear you.

Re:I Like PHP by maqr on Wednesday August 10, 2011 @04:18PM (#2869988)
> PHP is exactly like C. Either you like both or you don’t like either, there is no claim you can make about PHP that can’t be made about C as well, and vice versa.

This is absolutely satire. I don't think anyone can troll much harder than "PHP is exactly like C".

Re:I Like PHP by twinge on Wednesday August 10, 2011 @09:55PM (#2871009)
Cedric used to work for Google. He was, on occasion, a brilliantly hilarious troll.
Re:I Like PHP by FuzzyDunlop on Wednesday August 10, 2011 @05:40PM (#2870336)
The best one has to be running your site from a git repo.

I'm not sure why running old code on an old server that has support for the old code is considered a good thing about PHP. I love BASIC because I can boot up a C64 and the code I wrote 20 years ago still works today!

Re:I Like PHP by billmcneale on Wednesday August 10, 2011 @08:35PM (#2870837)
> The best one has to be running your site from a git repo.

What's wrong with that? `git pull` to update everything to the latest HEAD, `git co -- HEAD~1` to roll back the latest update, `git diff` to see the latest differences, etc...

This repo doesn't have to be the development repo, just a specialized non-bare repo that's used just for production. It works great for simple sites that don't require extensive deployment infrastructure.

Re:I Like PHP by twinge on Wednesday August 10, 2011 @09:57PM (#2871014)
Careful with that, git operations aren't atomic. Safer to keep two git dirs and flip a symlink between them between pulls.
Re:I Like PHP by chc on Wednesday August 10, 2011 @04:01PM (#2869910)
I really did consider that since the other posts by the author sound considerably more sane, but he's incredibly good at deadpan if so.
Re:I Like PHP by nl on Wednesday August 10, 2011 @08:24PM (#2870819)
I suspect you are missing some context here.

Cedric wrote the book on unit testing (literally! [1]). He uses PHP at times when he doesn't need the reliability unit testing gives you and can't justify the extra time it takes.

Given that he works at Google, I suspect his "in production" doesn't actually mean big, real sites.

[1] http://testng.org/doc/index.html

Re:I Like PHP by eropple on Thursday August 11, 2011 @09:59AM (#2872832)
I'm less astonished at his lack of unit testing (because I often eschew it in PHP projects, too) and more the, uh, everything else that he said that was horrible.

And I don't care if it's a "big, real" site or not, making mods to a live site is (almost) never good practice. Fix it offline, test it, push.

Re:I Like PHP by chc on Wednesday August 10, 2011 @03:39PM (#2869839)
From your description, it sounds like Crockford's "JavaScript: The Good Parts" to me.
Re:I Like PHP by pavel_lishin on Wednesday August 10, 2011 @03:57PM (#2869893)
For the record, "PHP: The Good Parts" is downright fucking awful. Apologies to the author if he reads this, but I'll buy him a beer and restate my opinion.
Re:I Like PHP by AgentConundrum on Wednesday August 10, 2011 @08:04PM (#2870776)
I've not read any of the "The Good Parts" series, so I can't comment from personal experience, but I've heard that Crockford's book is the only good one in that series. He wrote it, and he wrote it well, and then O'Reilly decided to base a series about it, but didn't get authors who could write those books to the same standard.
Re:I Like PHP by eropple on Friday August 12, 2011 @07:34PM (#2879694)
This is pretty much dead on.
Re:I Like PHP by keypusher on Thursday August 11, 2011 @03:22AM (#2871843)
Weird, whenever I look up "PHP: The Good Parts" it comes back completely empty.
Re:I Like PHP by pavel_lishin on Thursday August 11, 2011 @10:51AM (#2873108)
Haha, I get it! Because the language is bad! Oh, you jokester.
Re:I Like PHP by eropple on Wednesday August 10, 2011 @05:48PM (#2870366)
As it happens, the introduction says, verbatim, "It's like PHP: The Good Parts, but that already exists and is terrible."

So, yeah. ;-) Still a ways off, though.

Re:I Like PHP by FireBeyond on Wednesday August 10, 2011 @07:31PM (#2870685)
"-considers something "robust" if it doesn't break old code, when the rest of us hate it because we have to live with register_globals and other horrors"

Agreed - as a PHP programmer (mainly in Zend Framework), who is now learning Python... I hate register_globals. With a fiery passion.

More importantly, as someone who hosts several photographer websites, I have a bone to pick with http://bludomain.com/ - congrats on your eighth birthday. Have you updated your code since you were born? It's a travesty that involves turning on almost every deprecated option in a php.ini. :\