My First Software Engineering Project: Ruby CLI Project

Alex Sanchez
5 min readOct 1, 2020

The Ruby CLI Project is the first project in the Flatiron School curriculum. My first software engineering project ever.

A CLI project, or command line interface project, is a piece of software you write where you create things (both classes and objects) that interact with each other and a user interface in the command line (terminal) that can interact with them. This specific CLI project is to be written in the Ruby programming language and is a an application of the concepts I have been learning since the start of the program six weeks ago and marks the end of the first module!

Being my first project, I opted to finally switch to using a local environment rather than continue with the in-browser Learn IDE. I had used VSCode a little from when I designed a website for a side hustle from scratch in HTML/CSS for fun, but I had never connected to Github and pushed commits before! It was new concept for me that took a while to get more comfortable with, and there’s still plenty more to learn about it! Admittedly, I definitely need to work on committing early and often and with good commit messages. It’s a valuable habit that I learned the hard way that I didn’t do it enough when I screwed up a tricky double iteration partway through my project and had last saved/committed my project shortly before figuring it out but after a different mistake where I exited out of my IDE. 😓

I started off early Monday morning of the first week of project week (we get two weeks in my part-time program, but I wanted to do my best to finish ahead of schedule, just in case) bright-eyed and bushy-tailed. Full of life and ambition! Maybe a little too much ambition, as my instructor had warned our cohort about there always being some people that want to bite off a little more than they can chew and the deadline ends up getting the best of them.

My first CLI project idea was utilizing the Yelp API to prompt a user for any location and return a list of vegan-friendly restaurants in that location, ultimately allowing the use to request more info on any restaurant in that location. For whatever reason, I had the hardest time wrapping my head around getting the API to work properly in the program I was building. I must have watched through and re-read all of the examples a half dozen times without making progress through my problems by the end of a late night. The next morning, I’d decide to not be too proud to admit when I’d hit a wall I can’t climb yet. I’d re-visit and figure out API usage at a later time. For now, I wanted to try my hand at scraping a website and create a more simple, straight-forward project: displaying the current roster of the Houston Rockets NBA team and allowing the user to choose a player and get some basic info on them.

Tuesday morning, not quite defeated, I started a new CLI project. I spent most of the morning with a singular issue that took me entirely too long to figure out. I had just started a new project and couldn’t even do the simplest test to make sure it was started properly!! It all came down to my bin/console file. At the top of the file, you always need what is called a shebang line: #!/usr/bin/env ruby to properly interpret your code in the language you write it in, Ruby in this case. The thing with this is it always has to be on the top line of your executable file. I was previously unaware of this fact and had mistakenly placed a comment above it to remember what it was and what it did. That was my downfall that morning!

I spent the entire rest of the day working through my project and its errors, slowly creating it to do what I intended. Late into the night, I reached another error that stumped me for hours with no luck in Googling or problem-solving of my own in my late-night state. My project was so close to working properly! I had finally gotten the entire roster to print to the terminal correctly, but when the user chose any menu option besides the first one, you’d get an error for calling a method on a Nil class! Honestly, I was just happy that my entire menu was finally displaying at all! 😂 I opted to call it a night and attend my instructor’s office hours the next morning.

Talking through it and working through my project code and what I wanted to do with my instructor, she helped me realize that, while I was wanting to have a team roster with many players initialized into the team and return all the players’ info to the terminal, I had mistakenly only initialized one roster object that contained the many players’ info. Due to this fact, it made it a lot more difficult to iterate through and return data for specific players. She helped me refactor my classes and class methods into initializing many players with their info and then adding them all into a roster object one at a time, thus being able to be iterated on and their info returned when needed!! Success!!!

After the much-needed help of my instructor, I was able to realize where I had gone wrong in my object creation and fix my program to properly iterate through my now many player objects and return their info to the terminal when needed! My project was finally working in a proper manner and the classes interacting with each other and scraping the website successfully. A breath of fresh air! I was now able to work my way through all of my code, attempting to refactor parts and keep my program DRY (don’t repeat yourself) while also styling the terminal outputs for a nicer looking, more readable program for the user. I find joy and satisfaction in creating a good user experience!

Overall, my first project experience has been incredibly humbling but needed. I know that I need to work harder to solidify basic concepts as I learn them going forward so that I can continue to build upon them. It’s important for me to take learning and reviewing concepts seriously in order to apply them in situations like these. The application of the material in a project was a lot more daunting with less hand holding, but I learned and solidified a lot of information and concepts. More so this time around than learning it briefly in a lab that I likely breezed through as fast as possible in an attempt to catch up after falling a little behind pace for a week. Now to schedule my project review and do my best to pass and move on to the next module of Flatiron School!!!

--

--