First impressions from a coding dojo

I know I’m quite outdated at this post from my first coding dojo (which was last friday), but never is too late.
I had never been at a coding dojo before, so at the start I felt myself kind of noob, on its formula.

What is a coding dojo?
Imagine a coding dojo as a meeting of programmers, where you put to work some of XP practices, like TDD and pair programming to solve any given problem. The main goals of a coding dojo is that you firstly have fun programming and seeing other people programming (the computer output is project to everybody at the dojo session). And also, acquire new skills, such as learning new techniques, languages, tools, frameworks and so on.

Coding Dojo formula
In a coding dojo, people are arranged in a way that 2 persons stays at the computer pairing for a certain amount of time (in our case, 7 minutes). Past this time, there’s a pair switch, where other pair take control from the computer, and also from the code, cotinuing from where the pair before were.
While the pair is working on how to solve the problem, the audience cannot take part on it suggesting ways of solving the problem or also suggesting refactorings to the code, while the tests developed under TDD are not passing (red).
And also the problem to be solved and the programming language to be used are chosen just before the dojo session starts.

The whole scenario
My first coding dojo was also the first coding dojo held at Caelum (where I do work), and like me, there were also some other people who was at a coding dojo for the first time. So for not pushing it too fast, we had chosen a common language (Java) and a really cool problem (How to divide a number represented as String without using the / operator?)

What I’ve learned
It’s interesting when you are in front of a crowd coding, and there’s everybody looking at what you’re doing. I’ve never had experienced that before, and it kind of intimidate myself a little bit at the beggining, but past some time I’ve got used to it, and it flowed pretty good.
Also, I’ve learned how boring it is to pair to someone who is tired, or whose mind is at the moon or mars. It just don’t work.
From the language there was nothing much to learn, because we used pure Java, which I work with everyday. So, nothing new on it.

What I’ve liked
It’s amazing when the crowd is all there looking at the problem and figuring out a way to solve it. Everybody, with the same goal and motivated. The feeling of being there was very intense and how the problem challenged us was also very interesting, and I really appreciated it.
By the way, when a test goes from red to green the feeling is very good.

What I disliked
I’m not sure if dislike is the best word to describe it, but I couldn’t figure out a better one, but I think that 7 minutes wasn’t time enough for a pair to fully participate on the problem. Maybe 10 minutes would be a best try (the ones who were there and also had experiences in a coding dojo said that 7 minutes are ok). Or maybe, It’s just a noob impression :) .
By the way, sometimes people talked aloud when the tests where red, this can take away your mind and concentration on the problem. So silence while the tests are red is essential.
We also hadn’t prepared a source control environment (lack of time), so we couldn’t integrate our changes at each pair switch.

Future Coding Dojos
We scheduled to run a coding dojo every friday. With a github repo available, so we can integrate our code at each pair switch.
And now with different languages, so we can learn much more on it. After all, that’s what a coding dojo is about. Learning.

Mirror DSL 1.2 – reflection made easier

Mirrors

Last sunday was released the Mirror DSL 1.2.

Mirror is a simple DSL layer over the Java Reflection API, with the intent of helping writing reflection code in a cleaner and non-intrusive manner.

Nowadays, if you have to write code that takes advantage of the Java Reflection API for setting a property value, for instance, you should write a cumbersome code like that:

Field toSet = null;
for (Field f : target.getClass().getDeclaredFields()) {
    if (f.getName().equals("field")) {
        toSet = f;
    }
}
if (toSet != null && ((toSet.getModifiers() & Modifier.STATIC) == 0)
        && ((toSet.getModifiers() & Modifier.FINAL) == 0)) {
    toSet.setAccessible(true);
    toSet.set(target, value);
}

While, with mirror you could do everything that this awful code does, in a single line, and also in a very expressive way. You could just say to mirror: “Hey, Mirror, please on the object referred by “target” set the field called “fieldName” with the value of this variable here”.

But, how to do that with Java code? Simple:

Mirror.on(target).set().field("fieldName").withValue(value);

You can find more information about Mirror at: http://projetos.vidageek.net/mirror/

We hope that everybody find it useful, and it would be of an enourmous pleasure to get your feedback about it.

Get Involved And Participate

Recently, I’ve attended to Rails Summit Latin America, and among some brilliant talks, there was one which impressed me the most. It was from Dr. Nic Williams, a well-known Ruby on Rails programmer, talking about how can everyone participate at the open source community.

During his talk, he explained about some tips for those who wants to get involved and participate in the open source community, like doing unit tests, knowing a versioning system such as git and svn, and taking part at some open source project, independently at the role that you play on that project.
But the tip that made me considering write this blog post was: “write a blog”. :) It doesn’t matter that you sometimes make mistakes on what you’re posting, the most important thing is, someone will always know a subject more than you do, and will post a comment correcting you if you’re wrong, and that way, the blogger will be able to learn from it’s own mistakes. And if you’re not wrong, awesome, other people will be able to learn from your blog. So that writing a blog becomes a learning cycle. Always.

In this space, I’ll discuss agile, TDD, algorithms, programming languages, tools and some other random stuffs that comes to my mind. Feel free to join the blog, post comments and interact.

So lets go get involved and participate. :)

Seguir

Obtenha todo post novo entregue na sua caixa de entrada.