The Velue of Practice

Michael Gallipo
2 min readJun 11, 2018

The instructor of our bootcamp cohort is frequently urging us to avoid the temptation to cut and paste, to type things out the long-way. While frustrating and time consuming sometimes, I get it. As humans we learn by doing and through repetition, ingraining muscle memory, both physical and mental. Think Malcom Gladwell’s 10,000 hours of practice to achieve true mastery. There is a downside though as retyping things can open up a whole new world of spelling and syntax errors in code that previously worked.

One of the features of Ruby and Rails that I have come to appreciate the most is that when your code doesn’t work, you are often guided right to the spot where the error is happening which can be very helpful in debugging recalcitrant code. However, as we have moved away from pure Ruby and into the world of mixed HTML and Ruby, I have learned (the hard way) that HTML often “ignores” errors. That doesn’t mean the code works, in fact just the opposite, it means nothing happens at all. Not whatever action you were attempting and no error message. This makes the debugging process a little more challenging.

We had recently introduced forms for entering new items or editing items in our front-end clients. As extra practice, our instructor suggested doing the same thing in an older contact project. So I took on the challenge. I didn’t cut and paste from my older app, I typed in the first line of my form (below), looked it over and said to myself looks good.

<div>
First Name: <input type=”text” name=”first_name”, velue=”<%=
@contact[‘first_name’] %>” />
</div>

Then I copied that line of the form enough times to cover all of my variables and changed the variable names in each instance (our instructor had said we were allowed this amount of cutting and pasting). I went over to my localhost:3001 tab ready to view my masterwork and got…. a blank form. No error message, but also no data! I pulled up my prior project (which worked) and started looking over and comparing every special character, every =, every <%, every “, etc. It all looked good. But still no data. My frustration level was rising, but I was determined to make this work. Finally at long last I noticed that I had entered “velue” rather than the “value” that HTML expected and needed. I fixed that in each line and voilà.

My takeaway from this example was that while it is natural to focus on the special characters in our code, you know, the things that make stuff happen, even the simplest of spelling mistakes can trip you up or said differently “all characters matter.”

--

--