From: Dave Thomas Date: 2002-08-28T06:38:24+09:00 Subject: Re: compile time type checking "Volkmann, Mark" writes: > Would you agree that with Ruby you have to write more unit tests > than you do in Java? Per function delivered? No, I don't think so. For example, the Java equivalent of names = people.map {|p| p.name } would probably merit a unit test. In Ruby it doesn't. I'd say my productivity is still way ahead in Ruby. Even testing is easier, as I don't have to worry about producing complex mock environments. > You need to test that the types of parameters being passed to every > method are what was expected. It seems that this would cut into the > productivity gains in writing the actual code when compared to Java. Why would I need to check the types of parameters? (Or, I guess more accurately, I've never felt the need to check the types of parameters). It just isn't a problem that crops up in my experience. > I really want to be convinced that this whole type checking thing is > a non-issue for Ruby, but I'm not quite there yet. I was there with you: I came from a strong-typing background and looked askance at languages such as Ruby and Smalltalk. Experience writing large Perl programs only reinforced my biases. However, writing Ruby code has made a convert of me. I'm just finishing a fairly large Ruby web application (22kloc of Ruby, which is just below the sentient level). The only time I missed compile-time type checking was when I made major refactorings and wanted to ensure I'd changed all the uses of a particular class. However, I still feel that there's no way I could have delivered this kind of functionality this quickly in (say) Java. My advice (having been there) is to try it. Give it a number of months, and try doing a decent sized project. Then form a personal opinion. There's no correct answer: it comes down to personal preference. Cheers Dave