The past few classes have been focused on Arrays. As we worked through the two Ruby Koans files dealing with arrays, I noticed that some of the students were completing the Koans quickly, but when asked about what they had just done, were not able to explain.
Running the Koans gives you output like this:
The answers you seek...
<"FILL ME IN"> expected but was <[1, 2, 3, 4]>.
Much like the answer key at the back of a math book, it’s a simple matter to copy the answer and move on to the next problem, which is what was starting to happen. I encouraged the students to really understand what was happening in each problem and to ask their pair partner, and then me if they were having trouble.
We culminated with writing a program having the following specifications:
- Ask the user “What are your three favorite movies?”
- Store the movies in an Array
- Print the movies out in reversed order
I was surprised to see that this project turned out to be more difficult for the students than I had anticipated. The final program should have looked something like the following:
Upon reflection, I’m starting to question the use of the Ruby Koans as a starting point for those without any programming experience. While it’s a nice introduction to the language, I think we’ve ended up glossing over many basic concepts like “what is a variable?”, “how do you do assignment?”, “what are objects?”.
For the next class, I’m going to focus back on some of these basic concepts and then (maybe) move on to the next set of Koans which is about hashes.