17
MAY2014
A Library in One Day
I was super inspired by Darius Kazemi's recent blog post on small projects, so I've been looking for ways to speed up my process.
Today, I tried an experiment: develop a library in one day. I wanted to go from an empty repository to a published gem that I could start using.
Topic
Obviously, I had to select a pretty simple idea to use. I wouldn't have time to do a huge project.
I think this may be the killer feature of this technique.
On one hand, you could argue that what I built may not be very library worthy. It's around 50 lines of code. It has ten specs and they really cover what it does. This isn't a complex beast and you could pretty easily hand roll a solution to replace it.
But in some ways that's the best part. I've dropped a 50 line pattern that I like down to a one line Gemfile
include. I'm making it even easier for myself to get some mileage out of experimenting with this code. I can mix and match this new library with other small tools to build up the ecosystem that I want for a project. Plus, if it turns out to be something I regret, it's not like I'm tied down to a huge dependency when I go to rip it out. This thinking actually has me wanting to keep this library minimal, at least for now.
Process
Here are the steps I took today:
- I began with, and spent the most time on, the README. This is a good idea. It helped me figure out what I wanted to build and why.
- I setup a basic project infrastructure by configuring Bundler, gemifying the project, and preparing to do some TDD. Later I circled back to add some documentation generation helpers.
- I wrote the code for the project. This was easily that smallest part of what I did today.
- I added documentation for what I had written.
- I made various tweaks, cleaned up some construction dust, and published the gem.
- I spent a little time tell people that I had made something, by writing this blog post for example.
I'll confess that I had cheated a little on number three. I didn't write any code before today, but having decided that I would be doing this experiment, I've been thinking it through a week or so. I at least had a pretty good idea of what I was going to do. This was partially made possible by the fact that I chose something I could easily keep in my head.
Project Scaffolding
It hasn't escaped me that half of the steps I took today somehow involved project setup. The bundle gem
command was helpful, but I found myself wanting to do some things a little differently and also wanting a little more help in some areas.
I know there are other tools in Rubyland for this kind of thing, like Hoe and Mr Bones. It might be worth looking into these options.
Alternately this may be one of those areas where if pays to spend a day (no more!) preparing your preferred workflow. I definitely have my own style, so maybe it's worth coding that up.
The point of all of this is that I think I want to find ways to reduce the small friction I felt today even a little further. I like moving at this speed and I want to work hard to keep it up. Steps like this seem to help with that. Darius even mentioned as much in the article that got me trying this new strategy.
Leave a Comment (using GitHub Flavored Markdown)