Testing, testing, 123
I am currently just over halfway through my coding bootcamp, and have learnt many valuable lessons in the past weeks from lecturers, instructors, and fellow students alike. But one lesson stands out to me most, and that is getting into the habit of testing your code.
Get Adiel Eichenstein’s stories in your inbox
Join Medium for free to get updates from this writer.
I don’t just mean testing it all at the end, when your page of code is all written out. I am talking about testing as you go. Line by line, every method you write, every relationship you connect — test it out.
At times you may feel confident in your code and it may seem easier to just keep going and not stop to test — but coders both new and experienced can make a mistake. It can be something as small as forgetting a comma, or making a word plural when it should have been written in singular, or adding quotation marks where they need not be. These mistakes are common, yet with the habit of constantly testing your code, you’ll catch them early on — before you’re stuck in a whole debugging party. Remember, it is much easier to find an error in one line of code verses in an entire page of code. So use rake console, check and test the code you’ve written in pry, and don’t forget to exit pry and re- enter every time you update your page.
It may seem like a “little” lesson, but trust me, sometimes the little things aren’t that little.



