I really enjoyed the jQuery Basics course on Team Treehouse. I think it really helped that there were 5 projects to do instead of just 5 minute lectures followed by quizzes. Each project was different, but they built on each other with knowledge. With every project, I was able to imagine what the code might look like before it was explained to me. It’s an amazing feeling when you realize you’re really starting to understand what’s going on.
But jQuery is also a pain in the butt. Or, rather, syntax is.
With one of the projects in Treehouse, I built Drawing application where the user could pick an existing color or add a new color and draw on the canvas. It was the longest project in the course and introduced the HTML5 canvas, but the coding wasn’t the hardest part. The hardest part was getting to the end and trying to figure out why the only color that worked was red, and only if you didn’t choose a different color first. Weird.
I re-read my code over and over to make sure it made sense. I even re-watched videos to make sure I didn’t miss anything. Then, I realized that there was one thing Andrew did throughout the whole process that I simply watched him do instead of doing it myself.
Open the Dev Tools!
If I had been doing it from the get-go, I may have noticed that when I click on any color but red, the value was always undefined. Always. Even if I went back to red afterwards. And, if I had caught that when I was coding that part of the project, I probably would have noticed that I forgot one
stupid little semi-colon.
Dozens of lines of code and it was broken by a semi-colon. Womp.
jQuery is fun, but don’t wait til the end to test your code. Just don’t.