// Java for( Enumeration e = parent.getChildren(); e.hasMoreElements(); ) { Element child = (Element) e.nextElement(); // Do something with child }
# Ruby parent.each_child do |child| # Do something with child end
Can’t you feel the peace and contentment in this block of code? Ruby is the language Buddha would have programmed in.
Sean Russell, author of REXML, comparing Java iteration with Ruby iteration
Share This