Putting It All Together

JaSON Rete
JSONRete
Published in
4 min readNov 16, 2020

Pieces spread out on the table of my mind. Learning to program truly for the first time is a daunting task. What I have learned through each module thus far seemed fragmented. Navigating these introductory lessons for Ruby, my first programming language, seemed impossible at first. I know everything we are learning is for an end, but I didn't see it yet. Where is the box top, because I couldn't see it! However, I will say from my experience in my software Bootcamp journey to become a software engineer, when tasked with building my first app ever with less than a month of education, I surprisingly knew enough to accomplish the task. It was not easy, but I was able to accomplish the goal. Everything I learned to this point could have been used on this first project, but that was unnecessary and would not have been practical or useful. I know when programming you aim to do more with less. Even with my beginner’s level of knowledge, I knew enough to build my first application.

Utilizing future lessons and experience will allow me to come back to this first application and refactor and tighten up the code, make it even more efficient. I probably will gain enough additional knowledge to do that in less than a month. This experience of building an application has instilled in me a more substantial understanding of everything I have learned. I was able to put some of the lessons together to form a picture, completing the task. When I use the Ruby language that I have learned, it seems mysterious. Also, as abstract as computer languages are being layers upon layers of abstraction. It all goes without saying under all that code and software is the abstraction of the hardware. Lastly, what is even electricity exactly! It is so unimaginable that a computer should work at all. Computers rule everything around me.

Zero to 100 is how fast this learning process has felt at times. We are moving fast. The first project assigned was to build a command-line interface (CLI) application with the Ruby language. One of the requirements was that the CLI consumes data through an external website’s application programming interface (API) or with web scraping. I chose to retrieve my data for my app with an available API for the select data I wanted. I did this through an API made available to the public configured with the data this particular website wanted to share. An API is fundamentally a friendly protocol that allows different computers and programs to exchange data with uniformity. Scraping is a more stringent process of collecting the data when an API has not been made available to consume data for your CLI from a particular website. So without an API to consume the desired data, all hope is not lost to consume the data, if you can browse the data you can scrape the data, for the most part. So with tools and techniques of web scraping in Ruby, you can collect whatever data you want for use in your CLI. An API is giving you a more focused cleaner form of data and a scrape may deliver more of what you don't want or need. Through the available tools and programming, you can cull and parse out your desired data of a scrape.

Zeal and tenacity are the mantras! I can do this! I can problem solve; I can figure it out! Also, realizing I am a baby programmer walking in the path of those before me. I know in these early stages I am not reinventing the wheel. A trail of breadcrumbs covers the start of this path. Computers have, in my lifetime, made life more comfortable. Code and programs should and will make life easier when possible in the life of a programmer.

Learning, as you do, is critical. Solutions arise from problems and challenges from the doing. In fetching the data from my chosen API via my API Class, my data is in a hash and has entirely more properties than I intended on using. I could write code to remove all unwanted properties, but it's much easier to extract the properties I want to use with metaprogramming. Enters, initializing with mass assignment, a tremendous breadcrumb. So I wrote an attr_accessor reader and writer, for the properties I wanted to have instantiated with each instance of my Objects through my model class. And iterate in the initialize method over each of the hashes key/value pair, from the attributes of the hash fetched from my API Class. Creating instance variables to match my properties. Done in conjunction with using the self.send method and self.respond_to? method. So if the key exists, it is being created. This process is verifying the wanted attributes and ignoring unwanted none declared attributes. The .send method is a different approach to call a method on an object.

Every challenge I endured with this project was coupled with discovery and triumph, pushing the limits of my capabilities, and I still made it through. This early experience has taught me that I will never need the box top if I have enough tools in my toolbox. Coding and programming can bring together the pieces of any picture your mind can form.

--

--