Category Archives: Programming

The Great Yahoo! Developer Experiment is Over

From Yahoo! comes word that a number of popular developer products, including the MyBlogLog APIs as well as Maps and Local APIs, are soon to be shut down.

The announcement is as tone-deaf as it is disingenuous; it starts by saying that Yahoo’s “commitment is unwavering” and then goes on to vaguely enumerate the number of products they’re eliminating. (Which begs the question: What does “unwavering” actually mean to Yahoo? If your surgeon has an “unwavering” commitment to your health, is it OK for her to occasionally perform surgery without¬†anesthesia? How much am I permitted to waver and still be able to say that I’m unwavering? Could it be possible that to Yahoo, “unwavering” actually means the opposite of what everyone else in the world thinks it means?)

This is a big problem because for every API that is taken away, applications will break. It’s a bigger problem for Yahoo because the more thoughtlessly they manage their platform, the more difficult it will be for anyone to trust them in the future.

When I went to work for Yahoo in 2005 I was given the mission of opening the company to third-party innovation through Web services and other developer products, to create a platform that would endure for the ages, enabling developers to create amazing new applications (and, hopefully, accelerate Yahoo’s¬†business). It’s become clear to me now that this was really just a poorly-conceived experiment, not a serious attempt at creating a platform, and I say this not as an ex-Yahoo employee, but as someone who advises businesses on platform integration today. In other words, my reaction to this is professional, not personal.

So my professional advice for prospective platform providers is to do whatever you can to avoid emulating Yahoo. For developers and companies who are thinking about doing any kind of integration with Yahoo, do whatever you can avoid them until the company’s commitment to providing an open platform is more clear. From a developer and platform perspective, Yahoo is unsafe at any speed.

Facebook To Let Others Play In Its Stream

Link: Facebook To Let Others Play In Its Stream

If true, this could be huge. It looks like the premise is that third-party developers will be able to get access to Facebook data (including photos) through new APIs.

This could make Facebook much less of a walled garden and give them a more compelling competitive response to services like Twitter.

About CodeIgniter

I think I’ve mentioned here before that I picked up PHP at the beginning of last year. Almost immediately I started doing projects for clients with it. Aside from the very infrequent bug fix to Approver.com and my VSLive demos, I hardly did any C# coding last year.

As I was coming up to speed on PHP, there was something about it that I (and many others) found maddening. It drove me crazy that three different PHP developers could come up with the same solution to the same problem in three different ways, and the fact that there are (for example) at least three database libraries to use PHP with MySQL wasted a ton of time. I’ve become a big fan of database abstraction layers over the past few years; in particular, Active Record and model-view-controller (MVC) appealed to me, although I was dispassionate about having to learn a whole new language like Ruby to get it, particularly after having just learned PHP. So in short, at the end of last year I found myself shopping for some kind of PHP framework.

I researched PHP frameworks a bunch on a project for an entertainment industry client back in December, creating prototype versions of their existing web site in both CakePHP and CodeIgniter. CodeIgniter was far and away the winner of the bake-off (particularly after it received the endorsement of my former Yahoo! colleague Rasmus Lerdorf).

CodeIgniter is nice because it makes the patterns for putting together applications obvious, but unlike other MVC frameworks it’s not doctrinaire. You can name stuff (like database tables and controller classes) whatever you like; it even lets you eschew the use of models completely if you want. I like this because it reduces complexity at the cost of the “separation of concerns” that MVC aficionados tout; I suspect that purists will be offended by this but I find it to be liberating.

CodeIgniter has a lot of other higher-level niceties — dozens of libraries and helper classes, including such as a session management library, parsers for various kinds of data, even an abstraction layer on top of image-handling libraries. There’s provisions for extensibility, but there’s no crazy plug-in API or anything — writing your own libraries is as easy as writing a class and writing your own helper is as easy as writing a function.

Getting stuff out of the database using CodeIgniter’s modified active record implementation is pretty simple too. After loading CodeIgniter’s database class library, you can write queries like this:

$query = $this->db->get_where('people', array('id' => 449587));

You can also add where clauses, sort conditions and so forth:

$this->db->select('first_name', 'last_name');
$this->db->from('people');
$this->db->where('id', 449587);
$this->db->order_by('last_name, first_name');
$query = $this->db->get();

It’s possible to chain all these conditions together on a single line, but I prefer putting them on separate lines for readability.

There are tons of other ways to get data using CodeIgniter’s ActiveRecord implementation, but you also have full SQL queries if you need them:

$query = $this->db->query('SELECT id, first_name, last_name FROM people');

Ultimately, get_where() is the naive case, and certainly the most commonly-used in my code anyway — I can’t think of a other framework in any other language that enables you to be this productive with data with a single line of code.

So I’m basically using CodeIgniter every day now, and the plan is to use CodeIgniter for all our PHP projects in the future, including Facebook applications. We’ve already done one Facebook app using CodeIgniter and that project went pretty well. We also used CodeIgniter for the Tinypug customer innovation platform that we just released yesterday as an open-source project.