160418 – 160424 — Total classroom hours: 15
This last week was as close as I’ve come to just smashing my forehead against the keyboard and calling the week good. That sounds a little dramatic, and it is, but the bright side is that I’m seven weeks into the program and its the first time I’ve been this frustrated, so I take that as a good sign. What caused this frustration? RSpec, seeds.rb, and before_action filters. Each were their own beast, and because I was trying to push past (around) the errors to continue making progress on the coursework, it was all a bit of a mess by the time I had my mentor meeting.
The RSpec and seed.rb errors were tied to each other. I could see from the test failure readouts that the tests were failing because of a validation error. I tried to just bypass the error by commenting out the failing test, but the next step in the coursework was to re-seed the database and that action was failing for a similar reason. It appeared this would have to be addressed. I assumed that there was a typo somewhere so I started working backward through the coursework. After digging back 6-7 checkpoints and not finding the error it dawned on me that it would probably be more efficient to work back through my git commits until the I could run a db:seed command and not have an error thrown. That was a much better use of my time, the kicker being that by the time I had found the general timeframe of the error I had to pick up shop and leave for work.
Once I got done with work (and thinking about this error for most of the day) I still had a tough time identifying what I had done incorrectly. At this point -for the sake of finding the error- I had commented out my own work and copy/pasted most of the coursework into my text editor. And still the error persisted. It was at this point that I decided to reach out to my mentor. We went back and forth with several messages. Me trying to accurately describe the error and the steps I had taken to resolve it, him trying his best to diagnose a problem of which he only has my error diagnostics to go on. We went back and forth for a few messages, and we came to realize that in my attempt at error diagnostics and commenting out lines I was commenting myself in circles and had actually ‘solved’ the problem very early on in the process. I guess the lesson is that at some point its probably not a bad idea to stop, keep any obvious errors that may have been found (typos, syntax, etc), un-comment everything and start those tests from scratch. That technique would saved me a lot of time. Now I know.
The other big hiccup for this last week were the before_action filters used to identify the role of particular users signed into the app. All I’m going to say is that these filters are kind of a beast. Most of the ‘unofficial’ documentation that Google concerned itself more with the strong opinions of people who have used it than the actual techniques to use it effectively. I get the sense that people are either all about these particular filters, or absolutely despise them. Being that Im pretty green I don’t have a strong opinion either way, but let’s just say I hope to not see another one anytime soon.
That’s a pretty thorough synopsis of last week. It was definitely an exercise in patience and error diagnostics. I was happy with how farI was able to get on my own in regards to error solving, so I feel like that’s solid progress. Here’s to a new week and fresh start!