Quotes: Sean Russell

November 21, 2007 at 9:56

Filed under: Computing, Quotes — Pistos @ 09:56
// 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

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You may use Markdown syntax in your comment.

Powered by WP Hashcash

Powered by WordPress.
Close
E-mail It
Socialized through Gregarious 42