Stuff about software development, agile and testing

Tuesday, August 21, 2007

Ruby open classes

This issue have been flamed in many blogs and Java programmers are not very comfortable with open classes that includes me. But its really powerful there is not doubt about it, like Neal ford said how many times did we created StringUtils class in our java project. But I guess re-opened classes should be organized in some way where everyone knows where to find it. When I say "1.hour.from_now" example in the rails book for the first time. I was really shocked, does it makes sense to have hour method in Fixnum and to add more confusion if you open irb and look at fixnum methods you will not see it at all.

One of the thing that Java programmers should get over is you cannot know a class in Ruby completely. In Java we could say that I know the String class, I know how many methods are there and what are those methods etc but in the world of open classes you never know. There is no replacement of communications, in ruby world its more important talk about your work with other teammates and unit testing of course.

Labels