DEV Community

KingKatraz
KingKatraz

Posted on • Updated on

MyBooks Sinatra Project

I just completed my Sinatra Project, and, I must say: it was probably the most fun application I had to work on. Having been able to build a full application as a future software engineer and also experience it as a user was a testament of the power that lies at the tip of our fingers by knowing how to code.
The idea for my application was conceived out of a real world problem I was having. I am avid reader, and like all avid readers, the books pile up and eventually it becomes hard to keep track of them. I wanted to build an app that a user could utilize to save a list of their books and also sift through in an easier manner. With all that in mind, I wanted to create something super simple but sound enough to get the job done.
Since the beginning of the bootcamp, there is one thing that was more challenging than coding itself and that was getting error messages. My attitude towards this reality of coding made me dread it to the point where I felt like I failed at being a great coder every time I got one. What I quickly learned is that errors are actually a coder's best friend; they will point you out to the right direction and improve your work flow and coding abilities as you progress.
One particular error message I wanted to speak about is:
"NoMethodError: undefined method WHICHEVER_METHOD for nil:NilClass.
This is a fairly common error in the Ruby language which informs the coder of a method that has not been defined when it was called on an object. A particular instance of that occurrence happened to me when I tried authenticating a user that did not exist in my database. The authenticate method verifies the identity of a user that wants to access data. The mistake I had made was that I had forgotten to assign a value to the instance variable of user (@user) and when the method was called, it was not able to find any.
Knowing how to read and interpret error messages such as this will be a valuable tool to use in your journey to building applications and also finding solutions for many future problems.

Top comments (0)