In a conversation lamenting the delay in conversion between academics and practice, @mfeathers on Twitter said:
We’ll see. I think dynamic typing is a classic “worse is better” scenario. Won’t win arguments. Will win longevity.
Yeah, we’ll see. I’m really hoping not — dynamic languages really do suck for long-term maintenance. Ask the old Perl hackers.”
Then a realization hit me. Actually, it’s less of a realization and more of a hypothesis which needs testing. I’m curious to know what other people think.
Despite what a certain curmudgeonly ex-coworker of mine might claim, huge Perl scripts are a maintenance nightmare. They’re really a pain. Ranging from surprising overrides of $_ to wrong arguments being passed around to funky results from eval to magical exceptions, the major Perl applications I’ve worked on have had a lot of pain. The best helper to solve this problem is perl -c, use warnings; and use strict; — in other words, bringing more restrictive syntax and typing into the system. Prototypes even help, despite their unpopularity.
Yet there’s a major maintenance win with Ruby/Rails as opposed to the Java web frameworks I’ve worked on. So that cognitive dissonance hit me, and then I realized what the difference was: the configuration over convention. There’s less code to write in Ruby/Rails as opposed to the Java web frameworks, but that has more to do with all the magical injection than the language features themselves.
And there’s no reason that kind of magic can’t be done in the context of a statically typed language, provided some preprocessing to pull out the boilerplate.
At that point, you could have your cake and eat it, too.
Thoughts?
Related posts:
Pingback: Ruby is the Future | Enfranchised Mind