Monday, April 18, 2011

Headaches and fixing mistakes

You want to talk about Rails headaches? Ok, here we go.

While working on this shopping cart application this evening, I accidentally entered some code into the carts_controller test that was supposed to go into the line_items test. At first I just got frustrated, then tried deleting the cart scaffold and then generating a new cart scaffold. Unfortunately, the carts table already existed, so this didn't work. Then I tried creating a new scaffold called shopping_cart, but I realized that would be too tedious to work with, since every instance in AWD4R will mention cart instead of shopping_cart. Finally I just rolled back the migration, then generated the scaffold again and that worked. Success!

What did I learn from this?
Pay attention.
Keep calm and carry on.
Don't try to hack my way around problems - try solving them correctly.

I'm proud of myself for not quitting when I realized I had a problem and for eventually finding the correct solution. Other than this little hiccup (and it WAS a little hiccup, all things considered) I'm making a ton of progress. What does it say about me that I can't wait to get back to work on Manticore, now that I know how to run rake tests and fix errors that it finds?

One last thing. Speaking as someone with absolutely zero development experience, when I decided to take the advice of my friend Eli (aka jqr) I faced a gigantic learning curve. Here's how I got over my fear of just how much I had to learn: I looked the learning curve right in the eyes and said FUCK YOU. The best way I've found to deal with feeling overwhelmed or in over my head is to find a way to stop being scared of something new and start getting excited about it. Rails is no different.

No comments:

Post a Comment