Reflections on Writing a Ruby Gem

Writing an article and writing a bit of code are very different in many ways. But one thing that is the same is the beginning — the dreaded blank page!

That’s what struck me when I first started writing a Ruby Gem. Where do I start? How do I take this concept that is in my head and actually implement it as code?

Thankfully, Learn.co was very helpful. They provided a video tutorial for approaching the tall task. It at least gave me a starting point. Then I turned to my old friend Google to fill in the rest of the blanks.

I decided to build a recipe book of classic mixed drinks. Your Mojitos, Whiskey Sours, etc. I was tasked with scraping content from a website using Nokogiri and then my gem would run a CLI to display the content.

I came into this project with an understanding of how Object Orientation but having finished my recipe book project, the process is much more concrete in my mind. I understand file structure, how the Objects in the different files work with one another, how to properly set up an environment through which all these files interact. I also know how to push a Gem up to rubygems.org.

Through this process, I’ve realized a few things about myself and programming.

I know that I’m a very visual person. I understand interactions a lot better when it is laid out in front of me. Unfortunately, much of programming is conceptual. So I’ve taken to pen and paper to help me visualize how my program will work. Basically I say, okay my data comes in here, is stored in this variable, can be accessed over here with this method, etc. It then helps me peg out my program in Sublime and then implement my plan.

It’s also really important to break things apart and take gradual steps. It can be overwhelming to try to approach this task head on. But if you break it up, it becomes much more manageable.

Programming is something that can be extremely frustrating and also very rewarding. It’s why I think a lot of people love it. It’s such a challenge that is so maddening, but the end result is something tangible and pretty great. It’s why I really am starting to love it.