This is going to be a quick post today. I’ve been picking up some pretty neat topics but I’m gonna give myself a bit of a break and go to bed early for once. First things first, this week’s theme for algorithms is no longer recursion. Instead, we’re taking a step back and returning to more “basic” algorithms now that we have more tools at our disposal than just arrays and for loops. Today we had two algorithms: remove duplicate characters from a string, and remove duplicate words from a string. They sounded easy at first, but after working with recursion for a week and linked lists before that, we were having a hard time remembering how to keep them simple. Most of us were trying too hard to do something fancy with recursion and slices, but turned out that all we needed were a couple for loops and a dictionary.
Lecture was about scaffolding and routes today. I think I mentioned earlier that scaffolding basically writes a whole RESTful app for a particular model with a single terminal command. Scaffolding kinda does too much actually, but it’s a useful learning tool to see how to set things up properly in rails. We spent some time carefully examining the routes that scaffolding auto-generates, and then Instructor David had us build our own RESTful routes for a hypothetical to do list app from scratch. After that, everyone got into groups to actually build the simple to do list app. I was too far ahead for it to make sense for me to participate in the actual to do list app creation, so I just went back to my work on layouts instead.
After finishing up the layouts assignments, there were only a couple more readings about the asset pipeline and form helpers, and then I was done with the Rails I track! It was pretty exciting to finally get to Test Driven Development (TDD), so I dove in right away. I’ll have to write another more detailed post about TDD later, but so far I’ve only been writing unit tests for specific classes with RSpec. By the end of the day I finished the first half of the TDD track, “Ruby TDD.” The first half seems like it’s mostly about learning the fundamentals of TDD strategy and RSpec syntax. I’ll be moving on to “Rails TDD” tomorrow, which should have more substantial assignments. Anyways, TDD is a big topic, so I’ll write all about it in a later post. This weekend was pretty busy and I’m too tired to think.