Posts Tagged ‘Over my Head’

Learning concepts and building dungeons

February 1, 2010
dungeon view

'dungeon view' by Flickr user iscari0t

I’ve just got to the end of Chapter 6 in Beginning Ruby – “Classes, Objects, and Modules”. I’d say the complexity has stepped up a gear and that leads me to question how I learn things – and by learn I really mean ‘remember’.

Let me just say again, that Peter Cooper‘s explanatory style throughout what I have read so far is excellent. He explains things very simply without being patronising and regularly reminds you of simpler point which are related and which were shown in previous chapters.

However, I do think he makes it too easy to go through large sections with many concepts without testing what you have learnt. What I would like to see after every sub-section is some kind of small exercise, with the answers at the back. Alternatively, more small tutorials to explain each individual concept with challenges to modify it to do something slightly different.

I’ve found it too easy to just read through the book and whilst I think I understand most things (okay, ‘most’ is maybe an exaggeration!) I’m never sure whether I’ve actually learnt (remembered) the concept such that I could actually use it in anger, so to speak. In fact I’d go as far as to say I’m pretty sure I haven’t in most cases.

Chapter 6 covers, amongst other things, Local/Instance/Global/Class variables, Encapsulation, Polymorphism, Module, Namespace, Mix-in, Enumerable and Comparable. At the end of Chapter 6 is a little exercise to create a text adventure-style ‘dungeon’. I went through the exercise, and yeah, I made the dungeon, but it’s hard not to when all the code is there for you. What I’m wondering is is this the best way to learn? Should I leave this chapter with the ability to go off and make a dungeon from scratch if I wanted to? I know I couldn’t. Or should I treat it as a having been introduced to these concepts and understanding (most of) them if not remembering them all?

Dungeon Master

This is not at all what Peter Cooper looks like. Peter wears glasses.

Peter does actually set a challenge after the dungeon exercise to make it really interactive. Also, he finishes the chapter by saying he’ll assume I have a knowledge of how classes and objects work, and how the different scopes of variables work. Well… I kinda got it when I read it, but I couldn’t tell it back to you now – I don’t remember!

So, should I stop here and go through Chapter 6 a few more times (and maybe Chapter 4) until I’ve cemented it in my brain and then play around with the dungeon a bit more? If I actually could play around with the dungeon I would really know that I’ve got it all so far. This could take a while though! Worth it? I think I’ve probably answered my own question.

I wish I had a photographic memory!

Over my Head, Part I: Encapsulation

January 30, 2010

'encapsulation' by Flickr user Swiv

Of course I fully expect that over the course of reading Part two of Beginning Ruby there will be frequent “Huh?” moments.

I just had one in Chapter 6 “Classes, Objects , and Modules.


Encapsulation is the ability for an object to have certain methods and attributes available for use publicly (from any section of code), but for others to be visible only within the class itself or by other objects of the same class.

Ok, I think maybe typing that out helped me understand the concept but the code examples that followed did not make much sense to me.

I could stick around and try and get it or I could move on. I’ll move on for now. If it’s that important I’m sure I’ll encounter it again and its meaning will become clearer.

N.B. The Flickr pic above is one of the first Creative Commons images I found doing a search for ‘encapsulation’. It’s of St. Andrew’s Cathedral, which is near where I’m from. Hurrah!