I love Ruby. Its elegant, simple, clean, powerful and dynamic.
Python is pretty cool too, but its not as good as Ruby — its OO support seems ‘tacked on’ — I mean passing around self references? Come on!
But developing in these languages is nowhere near as good as in my favourite dynamic language — Java. Or rather, Java+IntelliJ.
Huh? Java is not a dynamic language is it?
Well not strictly, no. But in terms of the way that I develop — using IntelliJ to help me code — it might as well be.
If I were developing in a text editor with only a little support for the language, then Ruby would win hands down. I can create properties (getters and setters) really easily, things like the command pattern, implemented as Runnables in Java are elegantly expressed as blocks in Ruby. All of this is way cool and very very productive.
But I can’t refactor automatically. I can’t even rename a class and be sure that all references have been changed. And I won’t find out until runtime. Search and Replace just don’t compare to a Rename refactoring — and don’t even get me started about Move.
I am more productive in Java+IntelliJ — because the combination makes up for Java’s verbosity.
And that’s my point. Good code is not about using a smaller number of lines to achieve a particular piece of functionality. It is about how efficient and easy it is to maintain that code, to refactor it and keep it lean and simple. And that is much more dependent on the tools that you use than it is on the language you use.
Of course by ‘tools’ I don’t mean wizards and drag and drop abominations like Visual Studio or JBuilder. I don’t want a clippy that thinks it can write code better than me. I want a tool that helps me write code, so that I don’t spend valuable brain time writing code that is obvious.
The best way for a tool to present code to me (the coder) is as code. Isn’t that obvious? I don’t want to have to learn a new language (the language of yet another GUI bean wizard for example, or yet another GUI UML refactoring tool) to do something as simple as creating a getter or setter. In IntelliJ I just type x.getFoo() and press [Ctrl-Enter] and it does it for me. No guis, no mouse, nothing to distract me from the code.
Working with a tool like that is a joy — a tool that helps me write code efficiently rather than trying to write code for me. And that is dynamic code.