So I've been coding in both Ruby in Java quite a bit lately (and C++ too, but that's not so easily confused for some reason). I observed an interesting phenomenon today. I was trying to write a Java boolean expression at one point, and the following just flowed off my fingertips:
 if someString != null and someString.length() > 0 
IntelliJ told me how stupid I was just about as quickly as the text appeared on the screen. It said to me, "Hey stupid, 'and' is not a boolean operator in Java! And hey, where are your frickin' parentheses? What are you, like a dynamic language person or something? Shame on you! Don't you know the whole world would fall apart if you didn't constantly reinforce it with extra parentheses and syntax?" The red syntax highlighting in IntelliJ quickly got me back in line, and I swore I'd never offend it again with such happy-go-lucky poppycock.

Another similar experience occurred later this afternoon, when I found myself wondering, "Where is the java List.find() method and how do I give it a closure to execute?" Oh silly me, I was doing it again. Closures in java? What was I thinking? I went to the bathroom and splashed some cold water on my face to wake up from this ambiguous land of juby or rava or wherever my brain was.

The interesting part of this story is that when I went home and started playing with ruby, I didn't start thinking, "How can I add more parentheses? How can I turn this closure into an annoying class that implements a few obscure interfaces?" To me, it was a good real-life example of how the good ideas behind good tools stay with you because they're good ideas. In other words, a closure is really handy, and so is simple and expressive syntax, so my brain didn't want to let go of those ideas. It wasn't just a difference in dialect.

1 Comment

  1. Mom Says:
    yet another reason that I am a dentist.Although I like the idea of good tools sticking with you because they are good tools. I understood that much.

Leave a Reply