Did you ever wake up and thought “Today, I’m going to write the entire app in one attempt”? How did it go for you?
One of the hardest thing for me while learning coding was to understand what my lines of code actually do. I would write ten lines of code only to see it do nothing, and have no idea where to start debugging it. I would assume my entire logic was incorrect, erase it all only to find out later that I used .each instead of .map.
My biggest AHA moment was to discover tools available to test what my code does as I develop my functionalities. Let’s take a look at few examples I cannot imagine my day without.
Use Irb to Master Ruby
Run irb in your console to access Interactive Ruby console. Can’t figure out if you need to use .map or .each Test it.
One will show you all of the repos available, the other will only show repos that do not already belong to the user. How can I make sure that this method works correctly? Fire rails c in your active application folder and test it.
Remember the example I displayed at the beginning of this post in my Nokogiri project?
Be smart and seek out helper tools to do your work efficiently.
Test lines your don’t understand.
Test methods you just created.
PLEASE, Work off a separate branch.
Test your commits.
Enjoy it :)