Configuration files and dynamic languages
A few months ago, Carlos Perez blogged about someone else's claim to have built a mildly complex web app using Ruby in just two months. Perez argued that one reason Ruby-based development was so much faster than Java-based development would have been was:
- Java web app frameworks typically use lots of configuration files.
- These are effectively dynamically-typed (i.e. checking is done at runtime, rather than during a compilation phase).
- If you're going to use dynamic typing, you're better off going all the way, rather than trying to weld dynamically-typed configuration onto a statically-typed language.
Perez offers no evidence to back up his argument, but it's an interesting one nonetheless. Hibernate, Tapestry, Tomcat itself, and many other current-generation Java tools require XML configuration files that are so complex that users are effectively doing bilingual programming, without having a debugger for one of the two languages.
In contrast, dynamic languages like Ruby and Python allow users to type in complex data structures directly, and make it easy to include calculated values. This is (in my opinion) the main reason why SCons (a build system written in Python) is easier to use than Ant: one language, with a debugger, and you don't have to jump through hoops to say "for each" or "only do this if A and B are true, but C isn't". Even Ant's inventor agrees: a few months ago, James Duncan Davidson wrote:
Now that entire books are being written to decry the complexity of Java application frameworks, and urge us to return to simpler code, it'll be interesting to see whether more programmers switch to dynamic languages, or whether the continuing backwardness of those languages' application frameworks drives programmers back to Java and .Net.