Wednesday, March 19, 2014

Week 7 Day 3: Aspiring Rubyists Experience Learning

Major Activities of the Day: We began today with an exercise Avi calls the "Rails Bug Hunt," where you take over a codebase with a bunch of pending tests, write the tests, watch them fail due to bugs in the code, and then fix the code so the tests pass.  I enjoyed it a lot, and it was a good way to show us how important it is to thoroughly test your code.

In blog post time today, I presented a new post, about how to properly hide secret data when you're using version control on an application you're developing.  You can read it here.

We had a lecture about AREL today.  AREL (described on its Github page as "A Relational Algebra" or, alternatively, "Arel Really Exasperates Logicians") is a gem that comes with Rails that allows you to generate SQL queries on ActiveRecord objects more easily than if you had to write the SQL yourself.  We learned a lot about maximizing efficiency by using the right methods to query the database, in order to minimize the number of SQL queries (even if individual queries will take longer), because extra queries add lots of lag time to an app's performance.

Our evening assignment was to work on some queries involving boats, captains, and boat classifications.  The choice of topic was because Arel, our TA, is very into sailing (he used to be a sailing coach).  Doing the SQL to make it all happen was pretty complicated, and I didn't finish it all, but then again, it seems like no one else did either - it's hard stuff!

Skills developed: Writing RSpec tests on someone else's code, AREL

No comments:

Post a Comment