The Facebook API: The good, the bad, and the ugly

Posted: July 18, 2011 in Javascript, PHP, Programming, Web Development
Tags: , , ,

Everyone has heard of Facebook and used Facebook. It has become sort of a household name, and with the release of their API some time ago, other sites have been able to cash in on Facebook success by integrating parts of it into their site. Overall, the Facebook API is an incredible piece of software, offering developers ways to integrate the users social life with their website seamlessly, and it allows users to share account information and social information across multiple servers without having to remember a bunch of different login information. By the way, when I refer to the Facebook API, I am mostly talking about the PHP API and Javascript SDK.

However, where Facebook does many things right, it also does many things wrong. Now, I’m not saying that the Facebook API is bad or badly written or anything like that. In fact I haven’t really had a chance to examine to code for the API’s I use, so I’m not really in a place to make a claim either way. However, I do have some experience using it, and that experience has gone from awesome high’s where things finally worked and worked well, to horrible lows where the API would do everything but what I wanted it to do, seemingly of its own volition.

 

The problem, in my opinion, about the Facebook API as a whole is the lack of good documentation. Now when I say good, I don’t simply mean “Hey this function call exists. Its syntax is as so:…” but rather some documentation with more than 1 or 2 code examples, and some notes on certain caveats that come with the functionality. For example, take a look at this entry in the PHP.net manual. The parameter list is explained in great detail, notes are given about certain parts of its functionality that might not be apparent, and overall someone reading this would know most of the information on how to use the function. Compare this to almost any entry in the Facebook API documentation and you may see what i’m saying. If you browse through their documentation, on many pages you will find loads of comments with “Hey! I’m having this problem”, “hey me too”, “Hey me three”, etc. with absolutely no comment from the Facebook developers at all. Problems that should be rather simple become a huge headache because, in the end, you simply don’t know what the problem is, and the documentation provides no help.

For example, I was working on implementing a request dialog for a website, and used a simple one line piece of code from the documentation itself. I got absolutely no response when I tried to run this line. Upon viewing the documentation, it makes no mention of whether or not certain permissions are required (This is stated on another page as I came to find out) or if some kind of prerequisite function call was needed before trying to use this API call. This kind of back and forth is common to debugging Facebook API problems simply because there aren’t many places to ask about. Of course there are the developer forums, but half the time you see a topic relevant to your problem discussed, its the same “Hey! I’m having this problem”, “hey me too”, “Hey me three”, etc.

Now the documentation isn’t the only problem with the Facebook API. I’ve had instances where the API seemingly decides to work and not work depending on its mood, and random nondescript error messages happening sometimes, but not other times (and if you read the comments in the documentation, and in the forums, this isn’t an uncommon problem) Hell, I tried using the latest version of the PHP API once (this was a few weeks ago, I am not sure what the status of the latest version is now) and it straight up refused to work, and I had to re-download and re-upload an earlier version. It’s this kind of lack of communication and documentation from Facebook that can make working with the Facebook APIs a huge headache.

 

Now don’t get me wrong, the Facebook API is quite powerful, and an awesome addition to any site that has some sort of social functionality to it. However,  a word of advice for developers getting ready to implement some sort of Facebook connection with their site. If you plan on using the Facebook API, whether its immediately or down the line, plan for using it from the first step. Doing this can save the developer a lot of headache.

Comments
  1. Dom says:

    I would enjoy reading some updated FB tutorials written by you.

  2. Yeah I definitely plan to once I get around to it and figure out which topics would be good. If you have any suggestions for topics let me know

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s