Cache How I Preach

You hear the term “Eat your own dog food” and if you are like me your first thought is gross. Then you understand that it can be very good advice when you produce something for others. I like “Practice what you preach” a little more, but the same overall concept. Then comes the day you realize you should have taken this to heart on a much deeper personal level.

For me, it was a presentation. This was for developers and I was trying to deliver an experience I have never had in attending or watching an online a talk that shows some code. The experience of readability from a stage. In my case here it was JavaScript and PHP. This is normally missing as slides are hard to read from far away in the first place, or large font snippets of code don’t show the whole picture. I set out to change this by serving a console that showed code running in browser on their devices. Not unlike codepen or jsfiddle. Code on the left of the console and render said code on the right. Here is what it looks like:

 

The writing of the code was to be taken care of by importing source for GitHub gists. Part of my presentation was encouraging caching. For RESTful API calls mostly. I tested and tested before the presentation and everything worked flawlessly. Final test and there was a hiccup. No imports. What had worked great up until then failed completely. I restart my local server and things are fine. Great! Then I began.

The console and code imports felt pretty slick at first. Everyone got code and could read every line. Even run code I was talking about or skip ahead and experiment on their own if I was speaking about something they already were very familiar with. I did it. I was delivering the experience I wanted when I watched or attended presentation involving code.

Then my issue with importing code returned. My presentation was dead in the water as the whole point was easy code import. I restart my local server and nothing. Same issue persists. After a quick suggestion to just share the source on Slack, I had a work around. Everyone joined my slack channel and I chatted links to the source code I was sharing. Sure you had to copy and paste, but you got the code and the talk went on. People were still engaged asking for line numbers and question directly about the code in front of them.  They could read all the code and run any edits they added. The experience I wanted to give was still there. Just not a smooth as I was planning. I got lucky.

So what went wrong? The technical answer is GitHub blocked my requests for gists as there were too many or they were coming in too fast. The real answer is me. I didn’t practice what I preached. I was on a stage telling developers to cache their API calls, but I didn’t practice this where I should have when it was my turn. I knew better. Here is one of my unfinished GitHub issues I had opened for this presentation project:

screen-shot-2016-10-02-at-2-55-15-pm

Practice what you preach.

In the end, the issue was a net positive. Many developers joined my Slack channel and communication with my company and our developer partners improved for it. Again I got lucky.

Perhaps the biggest positive is the reminder to practice what I preach. I should have been caching my code samples and serving them up from local. I had planned to do it and didn’t get to it. Caching should have been a higher priority and I got bit because I didn’t make it so. I told everyone to cache the things. I should have been practicing this. We can all forget this from time to time or not see where we fail to “eat our own dogfood” or “practice what we preach”. Sometimes a bad reminder is needed. Sometimes it’s on a stage.

Even though I really did accomplish what I set out to do. I know it could have been more seamless. I am happy I took a risk in creating something new to deliver a better developer experience. Still, remembering the failing part is important too. It’s a good way to learn. I am not very upset by a technical difficulty or even my oversight. I am grateful there was a workaround and I do really look really forward to the next opportunity to deliver better.

This experience is now cached in my memory.

I will fail in some area again, but next time it won’t be for my lack of caching while on a stage.

 

dev-summit-2016-16-of-38-1024x683

Attendees using the code console





Comments are closed.