I have been working on a fun new project, where I get to work in Ruby.
After spending some time submerged in Ruby land, I am having some interesting thoughts.
The biggest point is that the code-to-learn is very high in Ruby.
You go from thinking “Hmm, I need to send an email in my code….” having never touched an email module, to writing the simple Net::SMTP code in minutes.
This happens with more complicated parts and pieces too, and I find myself spending way less time on websites and Google trying to work out a bizarre issues, and more time writing code to get my work done.
It isn’t all perfect though. I still wish that:
- I had a JVM (JRuby)
- Ruby could look ahead and not have to read my def before I use it
- I admit it. I like { } as delimiters. A lot more than “end end end end”
- IntelliR :(
That being said, these are all MINOR nitpicks (apart from IntelliR). I am having a great time solving problems at a nice, high, functional level of abstraction.
Oh, and I haven’t had a RuntimeException due to passing in the wrong type yet.
March 20th, 2006 at 12:56 pm
Agree on the “{}”. That and the “def”s keep putting me off any time I try to pick up Ruby.
Kinda similar with AOP. I’m sure their adoption would have been a bit higher if they had not chosen such stupid keywords.
March 20th, 2006 at 1:33 pm
“Ruby could look ahead and not have to read my def before I use it.”
This is only true if you’re writing some top-down, bash-style script. And I know that’s not what you’re doing…RIGHT?!
class Foo
def test1
test2
end
def test2
puts ‘yo!’
end
end
Foo.new.test1 # yo!
Works for me.
PS – Sorry about the formatting – it seems to strip my ‘pre’ tags.
March 21st, 2006 at 10:17 am
Check out Scala. It’s OO + Functional like Ruby, but it compiles to JVM bytecode (and also optionally to MSIL for the CLR) and it can use all of the Java libraries natively. I’ve been toying with it this week for the functional stuff, and I really like it.