yellow umbrella
Friday, May 27th, 2005i was at a yellow umbrella concert yesterday night. just wanted to say they make great ska music and the concert was awesome. and micha turned out to be a great dancer
i was at a yellow umbrella concert yesterday night. just wanted to say they make great ska music and the concert was awesome. and micha turned out to be a great dancer
yeah, i’ve finally started using ruby. instead of diving into the depths of ruby on rails i decided to start with something really easy:
i had written a simple tool in java that gathers a couple of text files from the file system, does a bit of parsing and creates an index html file as well as copies those text files to a new location. it consists of 4 classes:
java lines: 397
i then reimplemented the whole thing using ruby (don’t ask me why). the ruby implementation consists of the same classes minus the FileHelper, simply because ruby has built in file copying (even recursive directory trees)
ruby total: 126
well, what can i say. it’s obvious that the ruby solution uses way less code to achieve the same results. since that was my first playing around with ruby it wasn’t really faster than doing it in java, but i’m optimistic this will improve quite a lot.
for now just a list of my personal pros/cons for/against ruby:
attr_reader :property1, :property2 ...FileInputStream stream = new FileInputStream("xx.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
String line;
while((line = reader.readLine()) != null) {
doSomething();
}
stream.close();
file = File.open("xx.txt", "r")
file.each_line {|line|
do_something
}
i’m not sure why but it was real fun do code in ruby, everything just runs more smoothly, is easier and faster to achieve. if there was an ide like eclipse that could mark my typos and missing commas it would be even better.
i think i’ll try to use it as often as i can from now on. and i’ll delete that java version of the tool….
btw, i’m gathering links i find useful on my del.icio.us linklist
Tags:jode is an eclipse plugin that integrates a java decompiler into eclipse. no more ‘attach source’ messages when hitting a class file on source code browsing…
Tags: