This post originated from an RSS feed registered with Python Buzz
by Aaron Brady.
Original Post: 22
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
It’s not quite contributing to Open Source, but I have been strengthening some
atrophied Go and Ruby muscles with the excellentexercism.io. This
takes the programming koans or kata format (solve this problem, here’s a unit
test that will tell you if you’ve solved it correctly) and goes further.
I’ve only done a few exercises in each language, but more than just
hammering out brutal code to get the tests to pass, there’s a community
element which praises good code and nitpicks (their word) code which would
be improved.
My Ruby Hamming solution has three iterations, because I’d received some great
feedback from another user in iteration one, and then was inspired to look
closer at how my code could be more elegant after submitting my own second
iteration. It adds a whole other experience on top of getting a ‘pass’ from
your test runner.
My Go Hamming solution was way too complex the first time, despite
passing. The third iteration is an improvement but it still seems long - or
maybe it just feels long compared to how terse the Ruby version is.
Each language’s tests seem to be tailored to the languages idioms, too: the
Roman Numerals exercise required to me to extend Ruby’s Fixnum with a new
to_roman method, rather than just create a new class with a static method on
it.
Go check them out, maybe pick a language you know well for the first choice
and, once you’re happy you understand the algorithm required to solve each
problem, try something new.