Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Initial impressions of Ruby

Name: Anonymous 2006-03-11 7:12

Ruby is lol Object Oriented. That's why you can do -5.abs. In Java you would have to do Math.abs(-5), but Ruby is lol Object Oriented so you don't have to do that shit.

Unless you want to do say 1012.log10. Sorry, seems you have to do Math.log10(1012) after all.

Name: Anonymous 2006-03-11 10:28

>>1
In Ruby you can add extra methods to any class you like. Number doesn't have a log10 method? Well:
class Number
    def log10
        Math.log10(me)
    end
end
Unlike Java you don't have to rely on Sun implementing all the functionality in the classes you use. You add your own as necessary, without stupid subclassing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List