DEV Community

Cover image for Building my first Command Line Interface.
KingKatraz
KingKatraz

Posted on

Building my first Command Line Interface.

I have to admit: I'm not nearly as bright as I thought I was. I mean, maybe I am but something about building a command line interface from scratch as your first project in a software engineering bootcamp will have you questioning your own sanity. I am confident in my ability to learn but coding has pushed me through new boundaries. Learning about Ruby objects, control structures, instantiating classes and defining methods was the easy part; having to use all those concepts at the invention level and making a seamless and logical program out of all of it is a whole other dimension. Just when I think I understood a concept, the code returns errors that I spend hours on, but once done, it is the simplest thing on the face of the earth. My greatest challenge has been with building classes: I had taken my time defining its methods and listing the list of attributes that I wanted to use. Then I made sure to create a class variable to save all the instances. I had hit a wall thought because I realized that the array that my API was pushing through my code was empty inside my project when I called it the variable that references it. I had to review all of the code and inserted binding.pry everywhere to finally realize that I was not shovelling the instances inside the class variable. My second biggest challenge is to keep track of my class, variable and method names: it only takes so long before I am completely clueless about which is which when I am chaining methods. I call classes instead of variables and vice versa leading to the code breaking down and me wondering where I went wrong. This experience really thought me how to think a project through and develop good habits and routines as I'm working through it so that I can save a lot of time and energy while avoiding errors that really come down to typos. I also want to point out that no matter how much you try to follow instructions whether from your teacher or website, it is not guaranteed that everything will work for you; working with gems and API thought me that. resourcefulness is of the essence in this endeavor. I had learned how to use a gem called Rest-Client to fetch data from an API and for some reason, no matter what I did, it just wouldn't be accepted in my environment. I couldn't give up, so I searched online for additional gems I could used and came across HTTParty. this gem was a hail mary pass in the completion of my project because it worked perfectly with the API I chose. For all it's worth, coding has made me more attentive to details and I can't wait to learn more about myself and the code in the future.

Top comments (0)