APIs are Hard but fun

Currently I’m working on an abstraction layer for the Google Maps API, this is purely written in Javascript, allowing any language to produce JSON objects and pass them quite seemlessly onto a Google Map. Originally this was planned to be able to be used across maps APIs (Virtual Earth, Yahoo Maps) but has descended into just being Google Maps – to begin with anyway. Currently the plan is to provide a set of handlers that know how to process specific datatypes and interact with the map ie. placing the markers, drawing the routes and monitoring changes. I think going forward, this can really help us at Xebidy move quickly, building rich location based applications very quickly.

It has been mentioned a number of times recently (though I can’t think who, probably John Resig) that building API’s is hard and I can’t help but agree. While it’s definitely challenging, I think it can be an extremely rewarding thing to get right. Developers really do feel the benefits of having a well thought out APIs with productivity gains and less headaches.

One of the biggest curses yet greatest benefits of using Javascript is the many ways you can morph the language. Using ‘apply’ and ‘call’ you can provide a developer down the track some powerful built-in functionality. Throughout the XEMap API I’ve tried to avoid any developers ever instantiating a handler of their own (no new XELocationHandler). This lets me rewrite the this variable whenever or however I please. To store configuration variables I pass an options array to each function. This in turn leaves those functions to be reusable out of the context of the API.

4,639 thoughts on “APIs are Hard but fun

  1. I must express some appreciation to this writer for bailing me out of this type of crisis. Because of checking through the world wide web and meeting thoughts which are not pleasant, I assumed my entire life was gone. Living minus the answers to the problems you have fixed as a result of your good site is a crucial case, and the kind which might have in a negative way affected my career if I hadn’t come across your web page. Your primary natural talent and kindness in taking care of every part was important. I’m not sure what I would have done if I had not discovered such a thing like this. I am able to at this point look ahead to my future. Thanks for your time so much for this skilled and result oriented help. I will not hesitate to endorse the website to anybody who should get support on this situation.

  2. My brother suggested I might like this website. He was entirely right. This post truly made my day. You cann at imagine just how much time I had spent for this information! Thanks!

  3. I needed to write you a tiny note to say thanks a lot yet again relating to the precious information you have documented here. It was certainly incredibly open-handed with people like you to grant unreservedly exactly what many of us would have offered for an e-book to make some profit on their own, notably seeing that you might have done it if you ever wanted. These ideas likewise served as a good way to comprehend other people online have the same dream really like my personal own to know the truth more concerning this matter. Certainly there are several more enjoyable occasions ahead for many who see your site.

  4. I enjoy you because of all your valuable efforts on this web site. Gloria loves getting into internet research and it is easy to see why. I notice all relating to the lively form you give sensible tips and hints via your blog and as well welcome response from other ones about this idea and our favorite daughter has been discovering so much. Take pleasure in the remaining portion of the new year. You’re the one carrying out a first class job.

  5. Pretty nice post. I just stumbled upon your weblog and wished to say that I have truly enjoyed browsing your blog posts. In any case I all be subscribing to your feed and I hope you write again soon!

Leave a Reply

Your email address will not be published. Required fields are marked *