Archive for the ‘zendconference2006’ Category

Zend/PHP Conference wrap-up

Posted on November 3rd, 2006 in Frameworks, PHP, Zend, Zend Framework, zendconference2006 | 1 Comment »

It was a fun week. Of course, the big news on Tuesday was Zend’s new partnership with Microsoft, which promises to make PHP perform better with Windows in general, and IIS and Windows Server 2003 in particular. Zend’s own branch of PHP, Zend Core, will include even more improvements. Both Zend and Microsoft were obviously excited by the announcement, and I’ve got to admit that I was pretty impressed by the ease of configuring PHP in IIS 7. They showed some in-house benchmarks, but I’ll be interested to see some independent tests conducted when the final product ships (sometime next year?).

At some point during the same keynote, MySQL AB CEO MÃ¥rten Mickos jumped on stage for about seven seconds just to brag about what we already know—that MySQL is the most-used database with PHP. I wish he had spent a few more seconds, then, and explained why they clearly don’t bother to test their installations with PHP, since the default installation of MySQL prevents PHP from compiling if it also has OpenSSL (a somewhat common package).

In any event, the hot topics for this year were scalability and security, and there were lots of sessions on both. Eli White, the senior developer over at Digg, gave a great talk on scaling techniques (OpenOffice Impress format). George Schlossnagle, lead developer of APC and, frankly, entirely too many other PECL packages, followed up with his own excellent talk on scalability (PDF), which was naturally a bit more focused on caching.

Jaisen Mathai of FotoFlix briefly covered JSON and PHP, although (as with all of the sessions) the time constraints really limited how much he was able to talk about. After the session I mentioned Zend_Json to him—although any JSON library will do for encoding and decoding objects, I like the things attached to that one in particular, like Zend_Json_Server. In one of my projects I decided to expose entire PHP objects as JavaScript, modify them on the client using some Script.aculo.us voodoo, then return back the entire object. That’s the kind of thing that’s really useful when you’re dealing with complex data and needing a simple UI that doesn’t require lots of page refreshing, and although his talk was a good introduction to JSON/PHP interaction in general it didn’t cover interesting ways that JSON can be used outside of retrieving exposed, external information or your standard Ajax stuff. And to be honest, I felt like the examples in his presentation would have worked better as REST services. Oh well, you can only do so much with 45 minutes, and he was a pretty good presenter notwithstanding.

Unit testing also got a deserving nod from Sebastian Bergmann, creator of PHPUnit. His talk hammered home the test-first methodology and also revealed some new functionality in the upcoming PHPUnit 3, including being able to automatically run Selenium tests. That’s hot.

I should also mention that Chris Anderson, author of The Long Tail, gave an excellent keynote on Wednesday. It wasn’t particularly tailored to apply to PHP, though, as one questioner pointed out. Still, I’m just as (if not more) interested in business strategy as I am in software development, so I loved it. Plus, we all got free hardcover copies of his new book, so that was nice (I picked up two—my boss wanted one). Maybe it’s just because he’s been touting the concept for awhile, but I was impressed at how on the ball he was with the Q&A session at the end.

Andrei Zmievski of Yahoo!, though, won the prize for having far and away the most interesting session of the week—”Unicoding with PHP” (PDF). He walked through in great detail the challenges of creating a Unicode-aware PHP 6 that (almost) transparently handles the hellish details of the standard. I’m guessing the Japanese user-base is drooling in anticipation of being able to (among other things) use hiragana, katakana, and kanji to represent variables instead of the Latin alphabet. Andrei promised a PHP 6 Unicode pre-release to get the functionality out there and tested, so keep an eye out for that. I’ll link to it when it’s available. Update: Here it is.

Last but not least, the Zend Framework get-together was one of the highlights of the week. Meeting Gavin, Darby, Bill, Andi, and all the rest of the Zend crew (along with contributors and users like Richard and Keith) in person was great, and I got a t-shirt. BONUS.

Anyway, that’s enough for this post, and I haven’t even covered half of it. Really, if you haven’t been before and you’re interested in PHP, you really should make some time to go next year. Plus, you know… t-shirts!

The Zend certification exam

Posted on October 31st, 2006 in PHP, Rants, Zend, zendconference2006 | 2 Comments »

A couple of months ago, Zend unveiled the new PHP 5 version of their certification exam, which they promised would focus less on syntactical issues and trick questions and more on testing if you actually understood how to program pattern-based, object-oriented code—or knew enough about it to fake it, anyway.

The importance of a well-known, respected PHP certification is pretty simple: there are lots of crappy PHP developers out there. From my experience, most of the people that do job interviews can’t tell good code from bad, so having some kind of recognizable certification is a way to say there’s a pretty good chance you won’t spew out a bunch of ugly, unmaintainable code that someone else will just have to rewrite a year after you leave.

Well, I just finished taking it, and I suppose it’s appropriate that it’s Halloween because there were plenty of tricks on the test. Roughly one-third of the questions seemed to be along the lines of, “Assume you are an idiot, and you enjoy wasting your time doing stupid things. Here is an example of one of the many stupid things you might try. What would happen?” For example, what would happen if you had a PHP 4-style constructor and a PHP-5-style constructor in the same class? What is the difference in the return values (not the output!) of print versus echo?

Questions like these are bad because they rely solely on educated guesses about PHP’s behavior—after all, most people will not have tried to do things like this. That would be fine if PHP were consistent, but one of PHP’s biggest flaws is its complete lack of consistency. You can never really predict how PHP will react to an exotic code sequence without just trying it and finding out, because there are very few rules that apply across the board. Sometimes PHP will try to discern what you meant and other times it will error out. Occasionally, and most egregiously, it will fail silently.

Not quite as bad but still annoying is the third of the exam consisting of questions about functions that most PHP programmers rarely or never use. When’s the last time you wrote a custom stream, for instance? And perhaps like any good programmer who commits inane things to memory and never uses an IDE or PHP.net you have memorized all of the parameters of all functions, ever. Can tell me exactly what a “1″ in this particular argument position does? And if you want this particular behavior, should it be a constant in this spot or a Boolean value?

Now, to be fair, the entire exam isn’t like that, and if you’ve been adding in your head I’m only up to two thirds. The final third of the questions is actually quite reasonable and covers object-oriented programming concepts in PHP, basic design patterns, implementation of interfaces versus abstract classes, multiple inheritance, E_STRICT compliance, and so on. These are good—they actually test if you understood how PHP 5 works on a broad level, and understanding broad concepts is far more important as a programmer than memorizing the effect of little-used parameters and the return values of things that you would never want the return value for—even if you’re testing knowledge of a specific language.

We took the test on paper (I had been told it would be on a computer and scored instantly), so I have to wait a week for my results. I have been programming in PHP for seven years now (starting with version 3 in 1999) and strictly in version 5 for the last year and a half. I also attended an excellent, mostly-English 8-hour prep session by Christian Wenz as part of the 2006 Zend PHP Conference. Tellingly, Christian again and again said things like, “You’ll never encounter this in the real world, but it might be on the exam.” Despite all that, I frankly have no idea if I’ll pass or not.

As I was leaving, I rode the elevator with a fellow test-taker. “I feel like I’m back in high school,” he said, “and I just failed the SAT.” Tell me about it.

Update: I passed.

Note: None of the specific questions I’ve written here are actual questions I encountered as part of the exam. However, they are similar in nature for the purposes of example.