Take a look at this API: ClassNode#addProperty. Turns out that if you pass null into getterBlock and setterBlock, you get the default implementations. Maybe1. Normally passing null around blows up in unhelpful ways, but here null is a useful value. How is a programmer to know?
I’m increasingly convinced that immutability2 and strong type systems in languages aren’t just about concurrency or letting the computer optimize or catching bad code early. Increasingly, I’m convinced that the key value they provide is clear, meaningful, and maintainable code. Which is really the key problem in software development these days, isn’t it?
1 As of this writing, it’s an outstanding question if the compile phase of the AST transformation impacts whether or not the null values are translated: mailing list conversation.
2 See this nice presentation from Rich Hickey, author of Clojure.

This article was a post on the EnfranchisedMind blog. EnfranchisedMind Blog by Robert Fischer, Brian Hurt, and Other Authors is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
