Scalable Development Environments Slides

ZendCon07 is going very well so far. I’m done with both of my talks, and it’s all very fun. Great people, great atmosphere… Also, I just got my new camera - my very own Canon Rebel XTi - I’ve been playing around with it all day and will probably post some pictures soon.

Anyway I just uploaded the slides of my “Building Scalable Development Environments” talk to SlideShare:

The talk is basically a set of tips and best practices I picked up over the time for building a healthy, scalable development environment. It covers several topics such as coding style standartization, SCM / Branching models, Bug Tracking, Peer Training etc.

I hope you’ll find it useful, and if you have any comments, I’ll be happy to hear them.

In California for ZendCon07

My colleague Massi and I landed here in San Francisco yesterday after an exhausting 15 or so hours in the air (Tel-Aviv -> Frankfurt -> San Francisco). Trying to minimize the effects of jet lag (is that actually possible?) we did our best to not go to sleep and spend another 8 hours or so doing some sightseeing and just hanging around with some friends from the team (Zenders from Israel, Germany, France and the US). We also watched the Blue Angels air show that was on yesterday - it was nice, but not too exciting (after all, growing up in northern Israel I got to see enough real fighter jet action…).

Today we’ll do some more sight seeing (it’s my second time in SF, I have some family here and I really love the city). I’m staying at the conference hotel - so if you’re around, come and say hi.

Happy New Year, PHP Israel Users Group!

As some of you might know, the beginning of year 5768 of the Hebrew calendar is being celebrated in Israel these days - and for the new year, me and some friends decided to try and organize PHP-Israel - a local PHP users group in our land of milk and honey (or was itblood sweat and tears?).

So now we have php-israel.org (sorry folks, it’s all in Hebrew). It’s been around for less than 2 weeks and we already have ~40 or so subscribers to the mailing list - quite allot are Zenders but the majority are not, which is good. We also have some traffic - people are designing a logo and talking about a first meeting.

I’ve always thought there’s no PHP community in Israel - now I know there isn’t one because nobody tried to organize the quite numerous individual PHPers into a community. Hopefully, by next year, we will have a thriving local community of PHP users, spreading the word of the free web in Israel.

Shana Tova, PHP Israel!

Solve a CAPTCHA, help the world

I’ve just stumbled upon a great idea named “reCAPTCHA”. The idea is that you use their CAPTCHA challenges to protect your site from spammers and bots, or to hide people’s email addresses - but the cherry on top is that when people solve CAPTCHAs on your site, they also help digitize books by filling in words that OCR could not process.

According to the creators (from the site: “reCAPTCHA is a project of the School of Computer Science at Carnegie Mellon University “):

About 60 million CAPTCHAs are solved by humans around the world every day. In each case, roughly ten seconds of human time are being spent. Individually, that’s not a lot of time, but in aggregate these little puzzles consume more than 150,000 hours of work each day. What if we could make positive use of this human effort? reCAPTCHA does exactly that by channeling the effort spent solving CAPTCHAs online into “reading” books.

So they take the words OCR programs fail on (meaning: those are hard CAPTCHAs for bots to solve in the first place) and ask humans to solve them - and when they do, they use the words to fill in the OCR blanks. Now how cool is that? I’m definitely going to look deeper into this when I have a few free moments.

They even have API libraries in several languages, including PHP.

What I have always thought is now official

Ever tried looking up your name in Wikipedia? Check this out.
I knew it - and the title says it all.

Zend Framework and YAML config files

YAML has become quite a buzz word in the last few months. For those of you who don’t know yet (perhaps because you read my blog, and only my blog!?), YAML is:

YAML(tm) (rhymes with “camel”) is a straightforward machine parsable data serialization format designed for human readability and interaction with scripting languages such as Perl and Python. YAML is optimized for data serialization, configuration settings, log files, Internet messaging and filtering.

YAML is becoming popular for a good reason: It’s easy to work with, and lots of fun! If you’ve tried Symfony, you know it heavily uses YAML for it’s configuration files - a task which YAML fits like a charm for.

Being the buzz-word worshipers that we are, several voices have been heard in the the Zend Framework community for a YAML parser class, and most notably, for a Zend_Config implementation based on YAML. Pádraic Brady already proposed an implementation for Zend_Yaml, but for those of you who are impatient (like me!) and want to use YAML as configuration files in your projects today, here’s a simple and elegant solution:
[more...]

The M in MVC

In the last few weeks I’ve been thinking about models allot. Models, as in Model-View-Controller modules, are the most abstract and hard to frame-out part of this holy trinity (one might say Models are the “Holy Spirit” of MVC). So what’s the best practice here, if there is even one?

Models represent data and provide the means to preform data-specific actions. In a sense this is exactly what objects are (as in OOP objects) - so one might say that simple container objects are in a sense what the model should be. But in the real world, you almost always need data persistence, which means having some kind of storage mechanism to read from or write to. In the PHP world that’s almost always a database (and almost always MySQL) but it doesn’t have to be: Models could be based on RSS feeds, XML or other serialized data formats, web services, and more. In fact, $_SESSION could (and should?) be a part of your model. So data-layer abstraction could be a nice thing!

It gets even further - think about a model class which uses several data layers, mixing RSS feeds with locally stored meta-data for example; Or a Transaction class, that when saved, will both save local information in the DB and send an API call to PayPal, executing the transaction or fetching information from PayPal’s logs.

Well - getting back to my point, I was thinking about the best way to “frame-out” models and I have to say I didn’t come up with a good, practical solution. One of the conclusions I did made however, is that we are thinking completely wrong when designing our models. We (or at least I) have a tendency to design the model layer by starting from the storage and data access layers (the DB schema usually) and then going to the application layer. If you ever used Propel, it does exactly the same (as all ORM attempts probably do) - you design a database schema, and then build your model classes around it. Then, whenever your application requires some complex relations or data access, it becomes hell and you need to hack things together to make it work (try things like efficient batch updates, or efficient JOINs).

This is obviously wrong. We should be building or at least designing our application first - designing the logic, planning what sort data and what data related actions each action will need to perform, and then design model classes accordingly. These classes in turn will be used to design the data storage layer. The end result will probably be a set of classes for each DB table (or pseudo JOINed tables for that matter) but in run time, will be much more efficient and easy to use.

I am not sure how this can be done and even if this is possible - consider it to be a theoretical idea. But think of the possibilities when you start from the application layer and go down - instead of being limited by your data access layer.

You’re more than welcome to share any thoughts (or objections).

A Feature Worth Waiting For

In the last couple of days the PHP world is boiling with excitement, with discussions about namespaces implementation in PHP 6.0. In my non-internals eyes, Dimitry’s proposal looks both simple and elegant.

I have very little to say beyond what was already said by others - but there is one thing I feel needs to be said: A feature like namespaces is important and expected enough, and should be implemented even if it means postponing the release of PHP 6.0. Most PHP users didn’t migrate to PHP 5.x yet - so while they do that, both the planned Unicode support and the emerging namespaces suggestion can be implemented into PHP 6.0 - even if this means the release will be delayed.

ZendCon07 Acceptance

In other news, it looks like I’ve just been accepted to speak at the Zend Conference in October 07. Some people might thing this is no big deal if you work for Zend, but looking at the other speakers, and at the number of people who proposed topics, this is quite an honor for me just to be considered.

Right now I plan to deliver two talks: One which I already gave and IPC07, about Zend_Search_Lucene. The second, which will be more manager / team-leader oriented, will be about building scalable development environments - and in scalable the I mean procedure, infrastructure and people wise, and not performance / technology wise. So it’s going to be an interesting talk I hope - and not the regular technical mumbo-jumbo I usually get to talk about.

In any case the conference itself is probably going to be loads of fun and I’m really looking forward to it.

Zend Framework 1.0 is out

Happy times and great success! 1.0 is finally out, and I’m sure it will (already has?) got quite allot of coverage in the PHP blogsphere - and even got into the main page of Digg - so I’m not going to write about the framework too much - however I do feel a personal retrospection is in place…

I joined the ZF community back in May 2006 (at least this is the earliest SVN commit I could find) - I made some complaints about the HTTP client, and Andi suggested I take charge of it. One thing led to another, and I ended up rewriting the whole Zend_Http classes. Things were not always done the “framework” way (there were no proposals or specs up until later in the development process for example), but I think the result is decent and useful.

There is already lots of talk about the next stages - we’ve been in a feature freeze for quite some time, and I have plans for several requested changes and new components: It seems that in the last couple of weeks the growing interest got people to report bugs and ask for interface changes - ironically at the stage when it was to late to make any changes. So there is already a list of proposed improvements to Zend_Http classes - I plan on doing some work on Zend_Http_Cookie and Zend_Http_CookieJar - and perhaps one day also improve Zend_Http_Client doing things like creating a Zend_Http_Request class that will be inter-operable with Zend_Controller_Request_Http. Also, there is the much needed support for CONNECT requests for HTTPS proxying - and more.

Additionally, I put up (and am still updating) a proposal for Zend_Service_PayPal - a PayPal web services component. Hopefully this proposal will be accepted soon, and the pieces of code I already have can be moved from the laboratory to the incubator, and from there to the main library.

So the future of Zend Framework begins today, and 1.0 is definitely not the end - in fact, I have a feeling this might just be the beginning of, well urm.. a beautiful friendship ;)