prog: (monkey)
prog ([personal profile] prog) wrote2007-04-26 11:38 am
Entry tags:

Perl 6

I feel the gentle winds of conventional wisdom buffeting me towards Ruby.

Is there a practical reason why I might want to do this? Coz if I learned it just for S&G but then didn't immediately start using it for serious, I'd forget it.

"Dude, Rails" is not a sufficient reason, unless you can tell me why I'd want to use Rails over any Mason-based solution.

(Referring to Ruby as "Perl 6" is from [livejournal.com profile] xach, and the funniest in-joke I've heard all week.)

[identity profile] karlvonl.livejournal.com 2007-04-26 05:03 pm (UTC)(link)
I personally love Ruby, but that's probably mostly because it's the scripting language that I learned, rather than say Perl or Python. But if you already know Python, I'm not sure there's a compelling reason to switch to Ruby. That is, unless you're a big fan of object-oriented programming. Ruby is object-oriented through and through, as opposed to Perl and Python which sort of have OO bolted on. Heck, Ruby is the only language I've ever used that's so OO that you can actually call methods directly on literals, e.g.:

"Hello world".reverse
3.15.round

Also, Ruby's introspection and meta-programming facilities are very powerful, and make it a popular choice for developing domain specific languages.

And then, of course, there's the cartoon foxes:
http://poignantguide.net/ruby/whatisit.html
Chunky bacon!

[identity profile] dougo.livejournal.com 2007-04-26 05:49 pm (UTC)(link)
Ruby is the only language I've ever used that's so OO that you can actually call methods directly on literals

What, Java doesn't count? Strings are objects, just not numbers. (Although I wouldn't be surprised if that was added in Java 6.)

[identity profile] karlvonl.livejournal.com 2007-04-26 07:01 pm (UTC)(link)
Sorry, I didn't realize you could call methods on Java string literals. It's not something that's come up for me in practice.

[identity profile] jaq.livejournal.com 2007-04-26 07:24 pm (UTC)(link)
Java 5 and 6 have autoboxing, which can implicitly convert between object and primitive types for numbers in some circumstances. But that doesn't extend to letting you call methods on literal numbers unfortunately.

[identity profile] xach.livejournal.com 2007-04-26 06:39 pm (UTC)(link)
JavaScript and Smalltalk and Lisp all let you call methods on literals...