Archive for September, 2009

“How to grow a team” at Jax Italia 2009

Friday, September 25th, 2009

On November 12 to 14 the Jax conference will finally come to Italy. On the first day there will be my presentation on How to grow a team, where I tell a bit about my adventures in growing a team in Sourcesense. It will be part of the “Agile Methods & Tools Day”.

I’m very excited to be part of this conference; look at the (other) speakers! I hope I will see you there.

Workshop su design emergente

Thursday, September 17th, 2009

Summary: I will attend this workshop by Francesco Cirillo

Ebbene sì. Mi sono iscritto al Workshop di Design Emergente di Francesco Cirillo. Sarebbe stato da pazzi lasciarmelo scappare proprio ora che Francesco “sbarca” a Milano. E poi sono anni che non vado a seguire un corso; l’ultimo è stato l’ottimo corso di Project Management XP di due anni fa, sempre di Francesco. Penso di avere proprio bisogno di continuare la mia formazione :-) Come dice il mio amico e collega Tommaso, o si progredisce o si regredisce; non è possibile restare fermi.

Ci sono ancora un paio di giorni per sfruttare lo sconto del 30% sul workshop di Cirillo. Credo che sia un’occasione da non perdere.

A semi-forgotten design principle

Friday, September 11th, 2009

The common wisdom is that Ruby is slow and Java is fast. In general, it’s true. But is it always? Look at this simple test.

$ cat hello.rb 
puts "Hello world!"
$ ruby hello.rb 
Hello world!
$ time ruby hello.rb 
Hello world!

real	0m0.008s
user	0m0.004s
sys	0m0.003s
$


So it looks like it takes 8ms to run a simple “hello, world” in Ruby. How does Java compare to this?

$ cat Hello.java 
public class Hello {
    public static void main(String ... args) {
        System.out.println("Hello, world!");
    }
}
$ 
$ javac Hello.java 
$ java Hello
Hello, world!
$ time java Hello
Hello, world!

real	0m0.122s
user	0m0.061s
sys	0m0.028s
$


Even if we ignore the time it takes to compile the Java program, it looks like running the “Hello, world” in Java takes 15 times longer than Ruby. This is due to the long startup time of the Java Virtual Machine. The times you see here are taken on my MacBook Pro; they will be different on other operating systems, but not much different.

So what, you will say? “The startup time is not important! As soon as the JVM is up and running, Java can run circles around Ruby.”

I don’t agree that startup times are not important. The startup time for Java becomes much worse when you run complex applications. A vanilla Tomcat with no web applications installed takes about one minute to start up. Compare with Webrick, the Ruby web server, that is up and running with my web application in 3 seconds. The difference in startup times makes all the difference in the world when you’re developing software. It takes at least one minute, often much longer, to start up a Java application so that I can try it. There are times when you’re developing an application when you need to test it after each tiny change. It’s very difficult to do that in Java. The problem is made much worse by the fact that in general Java “containers” can’t reload changed classes without a restart. (Webrick can do that.)

What, you will say? “Matteo gave up TDD! He tests applications manually by clicking around like a monkey!” No, really, it’s not like this. I always write production code with TDD. That does not mean that you *never* test your stuff manually on the live application. Quite the opposite: there is a danger, with new converts to unit testing, that we trust our tests too much. I’ve seen people declare a story “finished” when all the unit tests are green, without ever checking if it really works! And of course, if you never test it manually, it will not work. There is a need for manual testing (some call it exploratory testing), even if you’re Kent Beck or Misko Every.

So I hope you’ll agree with me that short startup times are important for developers. But there are other implications. The fact that it takes a lot of time to startup a Java application means that Java developers are trained to write applications in a single JVM process. For instance, we often see dozens of web applications running in a single Tomcat. If you need concurrent operations, the solution is always to run more threads within the same process. And there is a big problem with this.

The operating system’s concept of a “process” is a very useful one. A “process” is a bundle of threads and resources: memory, open files, network connections, and the like. A process in Unix or Windows is a watertight compartment. When a process terminates, *all* of its resources are released. A process cannot easily corrupt the state of another process. A process can be given limits on how much memory or CPU it can take. It’s very useful to organize a concurrent application as a set of cooperating operating system processes. That’s the way the Apache Http server works, and that is a remarkably reliable software. It’s also one of the smart ideas in the Chrome browser, to run each tab in a separate process.

It’s a good design principle to have many small modules communicating with well-defined interfaces, rather than a single monolith where all the threads can interact in unforeseen ways. It’s also the way of Unix to design applications as collections of small communicating processes. Which makes me wonder how could Sun ever get us to believe that it’s a good idea to put all of our eggs in a single, huge process. Should not Sun be the champion of the Unix way? But I digress.

In conclusion, I claim that designing applications with small cooperating operating system processes is a good principle. Java current practice runs against this, but it need not be.

Chi viene a sentire James e Diana?

Wednesday, September 9th, 2009

Ho visto sul calendario di metodiagili.it (l’azienda di Francesco Cirillo che fa corsi) che ci saranno corsi con James Shore (The Art of Agile Development) e Diana Larsen (Agile Retrospectives). Sono un fan di entrambi i libri. E’ un’occasione da non perdere! Io mi sono iscritto. Penso che investire in sé stessi sia sempre un buon investimento.

Ci sono anche due corsi di Rebecca Wirfs-Brock. Non ho ancora letto niente di suo, ma c’è ancora un po’ di tempo prima che scadano i termini della early registration.

Birthday Greetings at XP Day Benelux 2009!

Wednesday, September 9th, 2009

I and Gabriele will present the Birthday Greetings Kata at the 7th XP Days Benelux in November. See you there if you can: it’s a very useful conference to attend.

Datemi feedback: che domande mi fareste?

Wednesday, September 9th, 2009

Per il prossimo Agile Day ho proposto una breve sessione intitolata “La mia esperienza di coaching”. Da due anni e mezzo sono “coach” per il team Orione in Sourcesense, e mi piacerebbe parlare di quello che ho imparato in questo periodo. Il ruolo del coach è molto meno documentato rispetto al ruolo dello sviluppatore. L’unico libro specifico sull’argomento che conosco è quello di Rachel Davies che è uscito da poco. E’ un ruolo che poche persone conoscono e ancora meno persone ricoprono.

Per questo sarebbe bello se le persone che hanno questo ruolo o ambiscono ad averlo si confrontassero. Dunque chiedo: indipendentemente dal fatto che la mia sessione all’Agile Day venga approvata, che domande mi faresti? Di cosa ti piacerebbe che io parlassi? Qual è il tuo requisito per la mia sessione?

Codice parlante al Bergamo XP UG

Tuesday, September 1st, 2009

Ho il piacere di essere invitato al Bergamo XP User Group per raccontare il materiale del mio post sul codice parlante. La serata è questo giovedì 3 settembre, e il luogo è (pare) la sede di Softcare a Torre de’ Roveri.