August 9, 2015 Log No. 318

Happy Fun Times with RSpec

…more like how I never knew how good I had it, blithely debugging code with pry and byebug, until I was introduced to the severely more structured and demanding RSpec. I mean, I totally understand how it’s useful and certainly, a well-written rspec file can serve as documentation for your program, but it uh takes some getting used to. And to write a really thorough and complete rspec, with testing of edge cases and all that, is tedious, I think anyone would agree. But yes I can see why it’s important to know it, and as a project grows, having well-documented rspecs would definitely increase robustness.

It doesn’t help that our first project requiring rspec testing is Poker, which, even in its simplest form of 5-card draw, has a bajillion comparison cases and various tie-breakers. So many tests! And the code itself is littered with case-switch statements. Coding Poker seems like more a test of patience than code, aha.

And now we’re moving past Ruby to SQL, in preparation for Rails (!!!). I’ve done some pretty basic stuff with SQL in the past, but that was all mostly through a MySQL web interface (so doesn’t really count, does it); this will be my first time really forming the queries on my own. Excited to start though, as SQL is used everywhere data collection is needed. And it’s silly but I really enjoy seeing the semicolon at the end of queries again–it’s like an old friend from “old-school” coding days, none of this newfangled Ruby “a variable can be anything” stuff.

Random aside: the book we’re using claims SQL doesn’t stand for anything and “Structured Query Language” is just a backronym, but come on, isn’t that too much of a coincidence?


Leave a Reply

Your email address will not be published. Required fields are marked *

*