Classy Web Development with Sinatra
An admission: I didn’t really do as many awesome things during the Bush administration that I would have liked to. So, now that we have a new president, I’m going to start off right by showing you something awesome.
While it may seem like I’ve had my head up in the clouds of physical computing, urbanism and monads, I’ve been nose down in something else. I’m super-excited to tell you, I’ve just finished the first two episodes of “Classy Web Development with Sinatra”, a screencast for the Pragmatic Programmers.
h2. The Particulars
Sinatra is a great subject. As I point out in the first episode, I think it’s very special in how it puts the smallest possible language over HTTP. Taken with the fun of building your own framework up from scratch, Sinatra apps are a ton of fun to write. Further, Sinatra really shines when you want to write micro-apps or services. Building an API for your Rails app by standing a Sinatra app up next to it to serve the API is a great approach for many applications.
If you’ve known me for a while, you probably know I had at one point aspired to write a book for the Pragmatic bookshelf. That didn’t work out (for the better, I think), but I still wanted to produce something to get the good word out there. I’ve enjoyed the screencast format from the beginning, and I enjoy teaching people interactively, so the format seemed well suited to me. Plus, I’ve always loved the sound of keys clacking in a screencast. Now you can hear my keys!
h2. Shout-outs
Lately, Ryan Tomayko has been absolutely kicking ass with his contributions to Sinatra and Rack. He was kind enough to review the script before we recorded and even put out a maintenance release so that we wouldn’t have to talk around a couple bugs that snuck into the latest release. The finished product is much better for his feedback and guidance.
From the beginning, Mike Clark has been a great mentor and guide through the process of producing a screencast. He helped me write to the beginner’s perspective and avoid speaking in a monotone. Throughout the process, he’s been more helpful and supportive than I could have ever imagined. Needless to say, he’s the foundation that all the goodness of the Pragmatic Screencasts series is built upon.
h2. I want to go to there
Go give the sampler a look, then buy the episodes! If you have questions, drop a message in the forum. And don’t forget to grab the example app and service off GitHub.
Great Nike ad
Beethoven’s Ninth and skippy video? You’ve got my attention.
How you do what you does
Alex Payne has an idiomatic and wonderful way of sharing the interesting parts of his workflow through writing. Bet you can’t read just one.
By far, I’ve found al3x’s Rules for Computing Happiness the most insightful and closest to my own “aesthetic”, as it were. It’s worth regular review, which is why I’m bringing it up right now.
See also, Workflow Voyeurism.
On news: beginnings
I first started trying to figure out the world, and especially politics, after September 11th. Before that, it was a topic of tangential concern. Afterwards, of course, it seemed critically important. My roommate at the time was a rather strong adherent to Fox News. I started reading weblogs that were pretty much the polar opposite in opinion. Somewhere in the middle, I frequently watched The Daily Show. I say they’re in the middle because, roughly speaking, they are not left or right wing but anti-idiot.
I quickly discovered two things.
First, everyone has an axe to grind. Trying to figure out that person’s axe is an unfortunate necessity to understanding whether they are a good source of news and opinion.
Second, twenty-four hour news and dozens of weblog posts a day are just too twitchy. To support that rate of production, you have to make a big deal about lots of things that are really no big deal at all. A daily news cycle is better but still intolerable. One week is the shortest term over which you can stand back and start to decide which events are meaningful.
Long-story short: I recognize Fox News as propaganda, dismiss CNN and MSNBC as too twitchy, realize that weblogs are too spazzy and that, in general, people are colored by their opinions and vetting them is not interesting to me.
Thor doing his thing
My wife doing the canine agility:
Go Thor!
More monads
“While we’re talking about monads”:therealadam.com/archive/2… you should read into the compelling argument that jQuery is, in fact, a DOM monad. It’ll set your mind straight. Also, give “All About Monads”:www.haskell.org/all_about… a look - I just started reading it, but it’s making a lot of sense.
DataMapper + Factory Girl
I’ve been toying with “Factory Girl”:www.thoughtbot.com/projects/… lately. The code I’m currently working on needs to generate lots of data before tests run and Factory Girl is handling this well compared to fixtures or coding my own data generators. So, in some unrelated toying with “DataMapper”:datamapper.org/doku.php, I came to wonder if Factory Girl and DataMapper play nicely together.
Turns out they do! The only hitch is you need @dm-validations@ in addition to @dm-core@. Since no one seems to have written this up yet, I thought I’d “share my results”:gist.github.com/49017.
Compare and contrast
Compare. “Suburbs built on top of military/industrial complexes”:infranetlab.org/blog/2009… - intriguing yet awful. Quirky and cute - “people re-enacting Far Side comics”:www.flickr.com/groups/fa…
Contrast. Assaf Arkin notes that the current “recession may bring us more apps that put function over form”:blog.labnotes.org/2009/01/1… Hopefully this means we won’t hear about Rich Internet Apps (blech!) for a while. On the other hand, hopefully we will see more apps that leverage “game mechanics”:bokardo.com/archives/…
On Feeds: Tactics
Ask enough people what feeds they read and you will quickly hear “too many” and “I suffer from information overload.” I’ve been there too; at one time I subscribed to more than five hundred feeds. A lot of people say you can’t really follow more than fifty feeds and do productive things. I’m not the most productive guy, but I’m comfortably following 239 feeds right now. My secrets:
- Man made the “mark all as read” command for a reason. Use it without shame.
- Skim aggressively. If the title grabs you, check out the first few sentences. If it doesn’t, just skim over the content and let the words and images that may jump out grab you. If they don’t, skip to the next item.
- Don’t add feeds out of guilt or peer-pressure. Know what topics you want to read about. Add feeds that align with those topics. If a feed looks really awesome but doesn’t match a topic, subscribe to it and put it in a “Trial” folder. Evaluate your trials every few weeks.
- Unsubscribe if you find yourself consistently skipping all the items in a feed. NNW and Google Reader both have attention readouts that can help you decide what should go. Do this sort of pruning every few months.
After reading feeds for several years, I’m finally starting to feel like I’m doing it right. How do I know I’m doing it right? Because I recently thought, “hey, I haven’t seen enough awesome today.” And then I open NNW and I’ve got awesome all over me.
Monads + Ruby = crazy
Guaranteed to boil your brain: do notation in Ruby. You got your monads in my Ruby! He uses ParseTree and Ruby2Ruby to rewrite your code. In other words: heavy.
I’d love to point you to a good monads tutorial, but the monad fallacy prevents me from doing that. I’ll try again once I fully grok them.
Awesome people, hacker spaces, double basses, dictionary
Brian Oberkirch is a big fan of people who are doing awesome stuff on the web. Me too! I’d add to his list: Ryan Tomayko, Greg Borenstein, Garrett Dimon, _why the lucky stiff, Jeremy Keith, Robert Hodgin, J. Chris Anderson, and Christian Neukirchen. My list, like his, is incomplete, so make your own!
A hacker’s space in Kansas is renting an underground bunker to house their activities. Recommended joke: those guys wouldn’t know a hacker’s space from a hole in the ground.
This image and story makes me want my double bass really badly. Don’t miss the story; it’s fantastic.
Pro-tip: go ahead and add refactoring to your system dictionary. You won’t thank yourself later, but you won’t curse the machine either.
On Feeds: My History
Ted Leung recently noted his “blog-aversary”:www.sauria.com/blog/2009… This reminded me that I’ve been reading feeds for 6-7 years. Shifting from reading centralized media like CNET, Infoworld and even Slashdot to individuals like “Matt Webb”:interconnected.org/home/, “Brent Simmons”:inessential.com and “Simon Willison”:simonwillison.net was an important event. For me, it was one of those moments where you realize there’s a whole other world of cool stuff to discover, explore and take part in. Certainly I would have a completely different character if I hadn’t discovered people out there on the web, doing their own cool stuff.
When I first started reading feeds, I experimented with some Linux stuff, most notably the crazy “AmphetaDesk”:www.disobey.com/amphetade… I quickly settled into loving “NetNewsWire”:ranchero.com/. It was the first app I purchased when I got a Mac, and I still use it every day, to this day. Call me a feed reading curmudgeon, but I still think it’s the best way to keep up with lots of sites.
I’ve gone through some shifts in the kinds of feeds I read. I discovered feeds and blogging by “Dave Winer”:scripting.com, so I started reading him and the people in his sphere of influence. I quickly figured out that said sphere is an odd social environment that has little relevance to what I do as a developer. For a while, I subscribed to the “must read” influencers, such as Boing Boing. I quickly found that firehose was too strong and, again, not relevant enough.
So instead of trying to figure those worlds out, I started reading more coders. Somehow that lead from reading people who do front-end coding to reading design stuff, which proved quite interesting. These days I’ve been subscribing to people writing about “information design”:konigi.com, “visualization”:www.flight404.com/blog, “open source hardware”:tinker.it/now, “game criticism”:www.rockpapershotgun.com and “urban design”:bldgblog.blogspot.com/. I’m finding lots of awesome there.
The Next Generation meets Reading Rainbow
Star Trek: The Next Generation was, for all intents and purposes, my jam. I was just the right age to enjoy it when it was on the air. Concurrently, I was the right age to watch Reading Rainbow. Ergo, the episode of the latter regarding the former was pretty much the coolest thing ever.
Comicus
“Matt McCray’s”:www.mattmccray.com Comicus is a CMS for “web”:www.zoodotcom.com “comics”:www.lilmonstas.com/. You may know Matt better for his excellent “CMS-in-a-Rails-plugin Comatose”:github.com/darthapo/… but he wrote this in PHP. More impressively, he wrote it in a style that doesn’t have all the grunting that is normally involved with writing PHP. He’s got classes, templates and everything! I salute you, Matt.
Generative Van Halen
I saw this last week (really!), but it appears the “blogger embargo” was broken on Sunday, so here goes.
“Microsoft Research released an app”:research.microsoft.com/en-us/um/… that lets you sing along to a drumbeat and then it generates music to match your singing. Many moons ago, an acappella version of “Runnin' with the devil” made it’s way on to the internet. Some brilliant joker used the former on the latter and you get: something that’s just not quite right. It’s especially interesting how the software tries very hard to accommodate David Lee Roth’s off-beat entrances.
In my opinion, the “DLR soundboard”:www.thetyser.com and the “Roth Alarm”:rothalarm.ytmnd.com are even better uses of the source material.
Vast social abstractions
We are surrounded by huge institutions we can never penetrate: the City, the banking system, political and advertising conglomerates, vast entertainment empires. They've made themselves more user-friendly, but they define the tastes to which we conform.
J.G. Ballard, via “Steve Dekorte”:www.dekorte.com/blog/blog…
Regarding the 2009 NFL playoffs
The announcers of the Pittsburgh/San Diego game went on and on about what good condition the field was in. I watched the game largely because there was snow on the ground. I wanted the field and weather to become part of the game. We get that so rarely in Dallas.
For some reason, I found myself hoping the Steelers would win said game. I’m not sure why; I’m chalking it up to a wacky world where the Cardinals are going to the NFC championship.
If the outcomes had gone slightly different this past weekend, we could have had two interesting SuperBowl possibilities. First, Pittsburgh vs. Philadelphia, an all Pennsylvania match. Second, Kerry Collins vs. Kurt Warner, the geriatric match.
This is the extent to which I can write about professional sports without going into my vast conspiracy theories. One hundred words without mentioning officiating ain’t bad, right?

