Tiffany B. Brown

a mish-mosh of stuff

Reverb 10: Ordinary Joy

Our most profound joy is often experienced during ordinary moments. What was one of your most joyful ordinary moments this year?

Ordinary joy for me comes in moments of coding. I love those moments when I am trying to solve a problem, maybe even struggling a bit, and then fix it.

That has happened several times this year, but the most recent was shortly before I left my job at Armchair.

We had a holiday e-card that was due to be delivered before our holiday party, on a Wednesday. I received the assignment Monday. Most of the front-end coding had been completed, but we wanted to integrate it with the bit.ly API.

That’s not a problem. Bit.ly’s API is well-documented. It returns data in JSON and in XML. I could just bang it out using SimpleXML to parse the data. Sprinkle in some Ajax and I’d be done, right?

Exceeeept the server we set it up on still runs PHP4 (I know, right?). Both SimpleXML and the JSON extension require PHP5. I had to — dun dun dun — JSONP.

I had never used JSONP before. I only kinda-sorta understood the hows of it. I remembered the technique from some code that I had to modify for another project. But write my own? From scratch? Yup. And it was easy.

I made the bit.ly API request, wrote my own callback function to handle the return data, and finished the project (just barely) on time.

Joy, I tell ya!

Comments are closed.