Unreasonable Fear

Sometimes, developers are a bunch of wimps.

We get so comfortable with our programming language that many of us are afraid to try something else.

Many of us learn one programming language (Java, C# or something else) and we stick to it no matter what. We do use libraries and frameworks and we’re often eager to try a new one in our project. But talks about learning a new programming language are usually met with quick rejection. We want to stay in our comfort zone.

I think something is wrong with this picture. Is learning Ruby on Rails really more difficult than learning Spring? Is Hibernate really simpler than activerecord?

Why are developers afraid of trying something new? Some problems can be solved easily in Clojure or Erlang. Are you sure Java/C# is the solution to your problem? It might be part of the solution, but probably not the entire solution.

Discovering ruby (and rails), I see flaws in Java that I didn’t see before. I learn a different way of doing things that expands my knowledge. When I come back to Java, I see problems from another point of view and sometimes use a different solution than I would before learning ruby.

Why are you still afraid?

Training On Hold – For Now

I planned on continuing my training sessions while I was on vacation. However it seems that I am even more tired after a day in the sun than I am after a day at the office. Go figure.

Anyway I decided to put the training on hold until I come back. A guy has to take a break from time to time. And it gives me more time to read and think about my objectives for the next year. That’s what I’m going to do for the next two weeks.

I’ll continue to do katas and small projects when I come back.

Keyboard Powered Web Search

For the past two weeks I’ve used DuckDuckGo as my search engine. It’s a search engine built on open-source software. What made me switch is the capacity to navigate through search results with the keyboard using vi-like keys (hjkl).

I didn’t know at the time but Google also allows you do something similar. You just need to go to http://www.google.ca/experimental/ (also works for google.com and I guess most other domains). There you can opt-in to be part of the Keyboard shortcuts experiment. That’s it! J/K are used to navigate through search results, O (or enter) to open them.

Hopefully this is going to be useful for the other keyboard junkies out there.

Touch-Typing Training – Results

As I wrote a week ago, I trained touch-typing this week. My objective was to attain 85 wpm. Here’s a recap of my week:

Monday : I decided to use Typeracer as my baseline. It’s an online game that allows you to race others. The fastest typist wins. I had not played in 6 months or so – and it showed. My score for the last ten races dropped a bit. This was not a good start. Result after the day : 74 wpm

Tuestday : I did some drills on goodtyping.com to get back to speed. It must have helped because I raised my speed to 78 wpm.

Wednesday : mostly played Typeracer. I managed to cut down on typing errors and I’m up to 81 wpm.

Thursday : I tried to practice at night instead of during lunch time. Without much success – 80 wpm. My fingers were not obeying me. I did a few drills on goodtyping.com to increase accuracy.

Friday : Success! I managed to consistently type over 80 wpm today by concentrating on typing slower but with less mistakes. I managed an average of 87 wpm on my last 10 races.

The week is over and I achieved my objective of 85 wpm. I did this mostly by reducing mistakes – they can get really slow you down.

Thanks to my colleagues who followed in my track and helped me focus on this challenge.

How to warn users not to use an interface

Everybody knows no one reads documentation. Hamcrest found an original way to warn users to use the org.hamcrest.BaseMatcher class instead of the org.hamcrest.Matcher interface.

Look at the interface yourself.

They added a dummy deprecated method called _dont_implement_Matcher___instead_extend_BaseMatcher_ in the interface.

I am still unsure whether I will ever use this in my own projects. But when this method appeared in my code today I could not help but look at it. It was then totally clear that I was not doing what they wanted me to do. I’ve seldom seen documentation that obvious.

Training week #2 and a challenge

This week I consolidated the two katas I did last time (Prime Number and Bloom Filter). Nothing much to talk about.

The only thing of note is that I got late in my RSS feed (again) so I missed the announcement of Corey Haines’ Learn How to Type Week.

I repent and decided to try my own this week (along with a few colleagues).

I’ll keep you posted about the results. I’ll work in increasing my wpm.

Developer in Training

I believe in software craftsmanship and in training to become better.

That’s why when I was challenged at work to take a few hours each week to train, I thought “What a great opportunity!”.

Well that’s what I should have thought. Instead I said: “But what about the project? The deadline? The world is going to end!”

Then I realized how lucky I was to work at Pyxis. I asked the Product Owner and it wasn’t such a big issue.

Lesson #1: Ask and thou shall receive

For my first training session, I decided to do the some katas in ruby as it has become my language of choice for pet projects.

Part 1 – Primes

I started my first session with the Prime Number kata. I like this kata since it is really simple, can easily be done in less than 30 minutes (closer to 10 once you’ve done it a few times) and I learned a few useful tricks in ruby by watching this kata permormed by Uncle Bob on Katacast.

I plan on doing the Prime Number kata every week as a warm up.

Part 2 – Bloom filters

Afterwards I tried kata #5 from http://codekata.pragprog.com/2007/01/kata_five_bloom.html – implementing a Bloom Filter. It’s an algorithm that probabilistically determine if an element is part of a set. It works like this : if the element is in the set, it will always return true. However if the element is not in the set, the bloom filter might still return true depending on some probabilistic stuff.

Training ends

Here are my highlights of the session:

  • I learned a new algorithm, it’s purpose and a few use cases
  • I performed everything in pure TDD
  • Continued to learn new keyboard shortcuts in Rubymine (I try never to use the mouse in katas. If there is a keyboard shortcut I forgot, I look it up and make a point on using it)
  • I managed to take some time to train!

The only downside I can think about is that I spent a little while trying to configure ruby 1.9.2, rspec and the latest beta of Rubymine 2.5 before reverting to ruby 1.8.7.

As for improvements, I see lots of ways to improve the Bloom Filter katas, especially when it comes to my tests. I’ll give it another try next time.

Git is not (just) Source Control

After many discussions with a colleague about Git, I came to realize that Git is not merely a source control. With time it became a tool in my developer’s sandbox. To develop software effectively, I need (among other) an IDE or text editor, a prompt and countless libraries. I came to rely and trust these tools.

I used many other tools for version control but I saw them as infrastructure – mandatory in the grand scheme of things but not used to improve my productivity.

Git changed everything by allowing me to rethink the way commits and branches work.

  • By promoting small commits that do one thing but do it well, git forces me to split my task in even smaller chunks that can then be commited. This sometimes leads to architectural changes.
  • By making it possible to  reorder the commit history (git rebase -i origin), it pushes me to make each commit clean and atomic.
  • Git makes branching cheap and easy. Like you, I try to code each features in a separate branch. But unlike you, I am undisciplined and often forget. However if I start on a feature and realize it takes slightly longer than expected (and I’m talking about an hour max, not 3 days), I create a branch for that feature. It’s easy and it allows me to work in small, independent chunks. It also allows me to always be able to come back to a stable branch if I need to do a few quick fixes on another part of the project.

Git is not a mere tool – it changed the way I design and code.

Shrinking your Team for Improved Productivity?

Unless things go sour in a project, a team rarely gets downsized. On the contrary, new team members are often added in the hope that more will get done.

What if sometimes, the best action to increase productivity would be shrink a team? I can think of two situations where reduced staffing is a good option:

  • The team realized that it grew too fast. Core team members do not have enough time to effectively coach the rookies.
  • A new features requires an overral architecture change. You can already predict that merging will be hell if new features are added while others are implementing the new architecture.

It’s not always feasible to remove team members – and it’s always a though decision. If the team grew too fast, you might not have any other choice. If you want to do it because you need a big architecture change, it might be possible to shift some members to another module or to start something new that will have no impact on a problematic area. You might also try to make the change coincide with half the team going in vacation (I’m sure many of you felt more productive when most of your team was away).

Next time you’re stuck and have a hard time finding effective ways to make the whole team work together, consider a reduced staff for a few weeks. It might be just what you need.

Quote – Organization culture

While going through Crucial Confrontation to finish up my mindmap, I came across an interesting definition of the word ‘nice’. It seems that many people describe their organization’s culture as ‘Nice’. So the authors came up with a new definition of the word:

Nice
adj. A pleasant, nonconfrontational attitude that eventually kills you.

Does that sound like your organization? If so it might be time to change your corporate culture.