Archive for the ‘apprenticeship’ Category

Update on my wiki

Tuesday, December 15th, 2009

Since i last wrote, i have gone in a few directions trying to get started with my apprenticeship wiki task, got a bit stuck, talked to Enrique a lot, thought a lot, and i think i’m on track now.

My first mistake was to focus on the test framework. I was pretty pleased with my given/when/expect framework, and it actually sort of worked, but it wasn’t really necessary for what i needed. In the spirit of “the simplest thing that could possibly work”, this is the bare minimum you need for a testing framework:

def assert_equal(actual, expected)
  puts actual == expected
end

My second mistake was to get carried away with making a web interface. I learnt a bit about WEBrick and how to embed ERB into a web page. That will become useful later, but it was the wrong place to start. After i had done all that experimenting, i still didn’t have anything remotely like a wiki framework!

Enrique asked me, “what is the most important part of the wiki?” – the answer is: content. If i have no content i have no wiki. So i am making it as basic as possible: creating a Page object and assigning it some content. Then i am moving on to a PageFactory that has the responsibility of finding pages. The pages may be stored in a database, filesystem, or even just in memory. It doesn’t matter for the moment. Whatever i decide to use, the PageFactory will deal with it.

My progress is now on github so you can follow along with my progress if you wish. The repository is sermoa/licky – licky meaning ‘little wiki’! :)

Welcome

Monday, December 14th, 2009

I’ve been at Eden Development for just over two years now, and the last few months have seen some very exciting changes. As well as a move to an awesome new office, there has been a real drive towards fulfilling the ideals of the software craftmanship movement. In that vein, Eden has introduced an apprenticeship scheme to help pass the knowledge and experience of senior developers to more junior members of the team. I have been lucky enough that our CEO Chris Parsons has agreed to be my mentor. With more than ten years experience as a software professional, I have a lot to learn from him both in terms of coding and also in how to manage projects and clients.

This blog will serve as a record of my progress during my apprenticeship, documenting my successes, failures and interesting things I find along the way. In this first post, I thought I’d give a brief overview of my journey so far. I was a relative latecomer to programming; I was 18 before I started writing macros in VBA to speed up repetitive tasks in my first job. I fell in love with coding immediately. I was covertly making a boring job much more interesting. It gave me an opportunity to stretch myself, creating things that made other people’s lives easier and, best of all, I was being paid to do it. The only limit was my own knowledge, but even when what I was writing was fiddly or downright frustrating it was always fun. I knew that’s what I wanted to do with my life.

After completing a degree in computer science and with a few freelance websites under my belt, I was fortunate enough to join Eden in September 2007. I’ve learnt a huge amount in the last two years, including BDD using RSpec and Cucumber, agile software development and how to work as part of a team to produce quality software that our clients love. But I still find it humbling to realise just how much is left to learn, and the journey that will take a lifetime is only just beginning.

A testing framework

Saturday, November 28th, 2009

Enrique has amended my task so that i cannot use any existing testing framework, not even Ruby’s built-in Test::Unit. However, i must practice test-driven development! Ha ha ha!

So here i am trying to ponder how to write a unit testing framework. Which is actually really nice because i get to decide the syntax i would like to use, and maybe – just maybe – i’ll come up with something that suits me really well and i’ll use again.

Enrique pointed me to the Given specification framework which i like because it uses the BDD ‘given/when/then’ approach for unit-level specifications. I’m already used to this kind of format for Cucumber features. Effectively, we use ‘given/then/when’ for Rspec, but it’s not made explicitly obvious. My comments in this trivial example should make it obvious:

describe "example" do
  before do
    @counter = 1             #(given)
  end

  it "increments the counter" do
    @counter += 2            #(when)
    @counter.should == 3     #(then)
  end
end

Now i think i could make the ‘given/when/then’ more obvious, and i can also simplify it. I might actually change ‘then’ to ‘expect’, meaning i can do away with the ’should’ method. Effectively i’m saying that whatever is in the ‘expect’ block should return true, otherwise the spec fails. Here’s what i’m thinking of:

spec do
  given { @counter = 1 }
  when { @counter += 2 }
  expect { @counter == 3 }
end

I suppose this is what people call a DSL – a domain-specific language. That is the kind of language i’d like to use to write my specs. I’ve never written a DSL before, but i’m excited by the idea of being able to write specs like this, so i’m looking forward to giving it a go!

A little voice in the back of my head is telling me i’m going to have to finally understand ‘lambda’ properly. Lambda is one of those things that never sticks in my head. I can look it up when i need to and blunder my way to making it work, but i never really understand what it’s doing or how or why. I have a suspicion that i’ll be making extensive use of ‘lambda’ in my testing framework! :)

The Apprentice (minus Alan Sugar)

Saturday, November 28th, 2009

I had the pleasure recently of reading ‘Structure and Interpretation of Computer Programs’, I have by no means finished it yet, but there was something on the very first page which really leapt out at me. The authors Gerald Sussman and Hal Abelson describe how grateful they are to have learned software development from the feet of masters such as Richard Greenblatt and Bill Gosper. Two particular heroes of mine. I started to think about the vibrant Open Source community and the Internet, how easy it is for us all communicate, yet how lonely software development is. We all work together in our remote locations, writing new features and submitting patches and very rarely communicate on a one-to-one level.

So who are my mentors? When I look back at the end of my long journey, who will I say are the people who mentored me? The masters from whom I humbled myself and for a period of time became their apprentice. In the 5 years that I have been on this journey of software development, I have been profoundly affected by the work and attitude of one man, Chris Parsons. Having left University thinking I had a pretty good grasp of Computer Science and modern development methodologies, I quickly learned that I knew very little. It was Chris who introduced me to Agile, BDD, XP, Ruby and the framework Rails. It was Chris who spent the first three months of my employment taking me from a naive developer with zero confidence, to a competent developer who knew that by using certain methodologies and best practices could write almost anything. The only limitation would be my own knowledge of programming languages.

On the 25th November 2009 he officially became my mentor. When he approached me regarding the position, it was a no-brainer, I accepted after a quick call to my wife :) Today I am really excited/apprehensive about the road that lay ahead. I know that long transition from apprentice to journeyman will not be easy. I’m expecting to stretched to my limits, but I know I have the passion and self-determination to make it.

I’ll be blogging here about my successes, failures and the projects that I work on. I’m looking forward to sharing my journey here, so check back from time-to-time :)

My new Apprentices

Friday, November 27th, 2009

Yesterday finally both of my new apprentices have accepted the role as an Apprentice at Eden Development.

I am very excited to be able to guide them on their long road to mastery. During the course of their apprenticeship I will be posting my thoughts on their progress, the tasks I have assigned to them and in general things related to their apprenticeship. Once their respective blogs are up and running (we are setting a space for that at the Eden Development web site) I will also add the links in here so that you can follow it up in context.

As I mentioned on twitter before; meet my apprentices, Aimee Daniells and Spencer Turner. Both are very passionate about building software and bring a unique set of skills to our workshop.

On Wednesday I gave them their first task:

I want you to write a wiki server in the Ruby language test first (i.e. TDD done right) using only the standard Ruby library but without using any available gem or testing framework (that includes the unit testing framework that ships with the Ruby language).

Both of them (separately) came to the conclusion that they would have to develop their own test framework. But…

Apprentice: How do I develop the testing framework without using a testing framework?
Mentor: Code just as much of the testing framework that will allow you to start testing it

More to it soon…

Eden Development

Thursday, November 26th, 2009

As some of you might know already my journey has taken me now to Eden Development a software craftsmanship workshop in the heart of Winchester.

Eden Development is lead by Chris Parsons, a very passionate craftsman whom I really appreciate, not only as a craftsman but as a friend as well.

This does not mean that NexWerk as such does not exist anymore; NexWerk is still my place where I will be muse about the craft, but mainly things about The Wandering Book and other software craftsmanship related things that are not necessarily in direct connection with Eden Development.

We are currently settling into our new workshop and we are all very excited about that. You will be able to read about it on the Eden Development web site.

I am also taking on new apprentices at Eden, which is a very exciting new challenge. You will be able to read their blogs about their apprenticeship and any other related things in the Eden Development website soon (you’ll have to be patient as we are overhauling it at the moment).

Another thing that has been going on this weeks (months I could say already) is the setup of Katacast, a place where craftsmen will share katas with a broader audience. If you have any kata that you would like to share don’t hesitate to communicate either to Corey Haines or to myself.

The Wandering Book is still on the road, and as far as I can pinpoint it on its way to Micah Martin. I hope it reaches there soon so that we all can enjoy the new pages he will add to it with his words of wisdom.

I hope to be able to post more often, so watch this space!

Apprenticeship

Wednesday, November 25th, 2009

I am pleased to say that today i have been offered an apprenticeship under Enrique Comba Riepenhausen and i have accepted! From this moment on we have entered into a formal mentor-apprentice relationship where i will learn as much as possible from Enrique, and Enrique will mentor me to become a better software crafter. I expect it to be hard work but very rewarding.

I am proud and honoured to have been given this opportunity. I am glad that it has become official because i need my learning to be accountable to somebody. I am great at starting new things but really bad at following them through. To be answerable to Enrique will be very good for me, and i know that there is a lot that i can learn from Enrique.

My first task is to write a wiki engine in pure Ruby, with no libraries other than a testing framework. So no Rails, no Sinatra, no Mongrel, no plugins. This is to teach me the real core of Ruby as a language, without relying on other people’s code for shortcuts.

I guess the first thing i need to figure out is how to make the application listen for HTTP requests. Which i can honestly say right now i don’t have the faintest clue! Let the learning begin!