TryRuby.org
TryRuby.org is a fun way to get started with experimenting
with Ruby. It's free and requires
absolutely no setup on your development environment. The website itself is your editor and
guide. It walks you through some basic
ruby syntax via experimentation and exploration. This guide is very entertaining and starts to get your ruby wheels turning.
A Quick (and Hopefully Painless) Ride through Ruby (with Cartoon Foxes)
I perused my way through Chapter 3 of Why's (poignant) guide to Ruby. After reading through all of
the jokes, comic strips, and witty humor I'm again pleased with how fun the
online Ruby community is making it to learn a new language.
The metaphors they use to explain certain concepts are both
entertaining and memorable. For example
- an array in ruby looks like this: [1, 2, 3]. The
poignant guide's description: "Think of it as a caterpillar which has been
stapled into your code. The two square brackets are staples which keep the
caterpillar from moving, so you can keep track of which end is the head and
which is the tail. The commas are the caterpillar’s legs, wiggling between each
section of its body." I'm looking
forward to reading the rest of the material.
But enough with the reading.. and on with the doing.
I'm a "learn by doing" kind of guy. Learning by reading is enough to prime the
pump, but digging and actually slinging some code is what really does it for
me. I decided that I'd start with a Kata that I never actually
completed before, the bowling Kata. Here
are my initial impressions:
- I have a Windows 8 PC that's been pristinely only Microsoft development box.. up until now. I've heard rumors of it being somewhat nasty to get ruby/rail/git running on a windows environment. I used railsinstaller, RubyMine, and GitHub for Windows. Setup was simple. Myth Busted.
- I'm enjoying learning a new testing framework, IDE, and language all at the same time. Although, when something breaks, it is very difficult to know where to point the finger (hint: mainly at myself!)
- I struggled a good bit getting the first test up and running. Even following the example code on RSpec's website wasn't working for me. I was snagged up with one of the requires. My tests couldn't find my class under test, and I ended up using a require_relative. I don't know if this is a best practice or not, but it fixed the issue.
- I also learned that the error messages that I was presented with mean almost nothing to me at this time. I'm sure that I will get better at interpreting what each error means, but unfortunately it wasn't as intuitive as I had hoped.
- RubyMine is pretty awesome. It's seems to be an easy transition IDE from Visual Studio. I'm still semi-terrified of using VIM. RubyMine lets me debug code, have a watch window to check out variables during run time, set breakpoints..Etc. This was key in helping me debug an issue when ruby was letting me combine a number with a range of an array. Ruby, why'd you let me do that? Oops!
- The kata took me much much longer to complete that I would have imagined and I'm not necessarily proud of the code I produced. That said, I think I still get a notch on my belt for TDDing my way through the very first Ruby program I've ever wrote. This code needs cleaned up, but I ran out of steam.
Comments & feedback are welcomed for the kata, tests,
and blog! Got any other cool things I
can try out to learn Ruby and/or Go?
Post in the comments section below and we'll be BFFs.
No comments:
Post a Comment