One Line at a Time With Ruby Koans
One of the big struggles I’m having with learning to program (there are many, and I’m okay with that!) is taking things slow, one thing at a time, and to not get ahead of myself. I’m often, to sometimes a detriment, a big picture thinker, getting ahead of myself and thinking about things outside the scope of the current concern. Programming, I’ve been learning, requires hyper focus on little things. One method, one, line, one word.
I often find myself, during frustrating moments, failing to do this and going big and wide in search of my program’s bugs and problems, instead of slowing down and moving line by line, word by word, to really focus on each element in my code to learn what is happening.
One thing I believe that has been reinforcing this for me is going through the Ruby Koans
. Set up as a series of tests, the koans guide you through learning ruby language, syntax, and structures. In order to move forword on the “path to enlightenment”, you must complete each exercise to pass each test, in order. This has been beyond helpful for me for many reasons. I’m reviewing little things I’ve previously learned about ruby, reinforcing my understanding of the language, all the while learning new things. But equally important, I’m learning to slow down and to hyper focus on one thing at a time, as the program forces you to do.
This is consistently reinforced when running the “path to enlightenment” rspec, which guides you to “meditate on the following code”, pointing you to a specific line in a specific program. In order to pass that test, you must focus on what is happening just on that line/in that method. Nothing more than that.
I work on the koans during my downtime or at lunch, as a break from the project we’re working on in class, or if I want to relax at home and not work on anything heavy, yet still feel like I am accomplishing something code-related. I’ve been, without realizing it at first, treating the koans as a form of meditation.