
-----------------------------------
wtd
Sun Sep 25, 2005 11:59 am

Article: Java Alternatives
-----------------------------------
An [url=http://www-128.ibm.com/developerworks/opensource/library/os-lightweight7/?ca=dgr-lnxw07RubyBetter]article from IBM.

-----------------------------------
MysticVegeta
Fri Dec 09, 2005 12:43 pm


-----------------------------------
*I know this is a long thread but since it was on the first page, I decided to reply*

I love the closure parts of the article between the comparison of Ruby and Java

array.each {|element| puts element}

'Tis absolutely brilliant! Are there lots of examples where Ruby beats Java in shortcuts?

-----------------------------------
rizzix
Fri Dec 09, 2005 12:54 pm


-----------------------------------
Yes there are... Although just to be fair to Java.. here's it's quickie:

for (Object o : array) System.out.println(o);

-----------------------------------
wtd
Fri Dec 09, 2005 2:46 pm


-----------------------------------
*I know this is a long thread but since it was on the first page, I decided to reply*

I love the closure parts of the article between the comparison of Ruby and Java

array.each {|element| puts element}

'Tis absolutely brilliant! Are there lots of examples where Ruby beats Java in shortcuts?

There are lots of fantastic uses of blocks in Ruby.  For instance, let's say you want to number the elements in an array as you print them.

array.each_with_index { |element, index| puts "#{index + 1}. #{element}" }

-----------------------------------
rodmayroar
Wed Mar 11, 2015 7:09 am

RE:Article: Java Alternatives
-----------------------------------
The knowledge that you have to post to this Web site. Like a river that flows along a saw, no holidays. We like to get to know them by sawing it. The knowledge you provide is endless.

-----------------------------------
rdrake
Wed Mar 11, 2015 7:43 am

Re: RE:Article: Java Alternatives
-----------------------------------
The knowledge that you have to post to this Web site. Like a river that flows along a saw, no holidays. We like to get to know them by sawing it. The knowledge you provide is endless.If there were ever a valid reason for necroposting, this would be it.
