Exploration Through ExampleExample-driven development, Agile testing, context-driven testing, Agile programming, Ruby, and other things of interest to Brian Marick
|
Sat, 10 May 2003Lisp with angle brackets, and static typing As an old Lisper, I find XML depressing. Many of the people who I'm certain would dismiss Lisp as unreadable seem to be happy reading XML. Even though structurally it's the same, just with more noise characters. So I'm with Dave. Being somewhat sensitive to being an old fuddy-duddy who doesn't do XML much, I try not to bash it. But here's a nice note comparing XML configuration to Scheme/Lisp. The same author's take on the current "static typing vs. testing" debate is also interesting. (See also postings from Bob Martin and Tim Bray.) He makes two arguments. One is that a type failure points you more directly at the problem than does a test failure. I don't find that too compelling. You need to write your tests (and your code) so that problems announce themselves clearly. My hunch is that such effort has all sorts of ancillary benefits, so I'm inclined to call this disadvantage a net win. (In the same way that testing pushing your system toward being less coupled is a net win.) (His comments on testing call to mind Glenn Vanderburg's on assertions vs. tests. More on this someday, perhaps.) His other argument is that people and tools can read explicit type documentation and derive useful information from it. I'm not sure of the argument about people. The Smalltalk convention is to use the type as the name of the argument. So a method's signature might be something like createKey :named aString in: aDictionaryIs that less clear than this? Key create(String name, Dictionary where);Only in that the return value is explicit, I think. (Keyword arguments are also a big win here, as are the descriptive names that seem - in my experience - more common in dynamically typed languages.) On the other hand, given that people are frail beasts, giving them two opportunities to say something useful - in both the variable name and type name - might help. It's the other argument that seems more compelling. Programmer's apprentices (tools) mostly work with static information, and statically typed languages have more of it there. I do most of my coding in Emacs, so I can't make a head-to-head comparison between, say, the Smalltalk refactoring browser and Java tools like Eclipse or Idea. I lack the experience to evaluate the argument. Does anyone out there have experience with equivalent tools in both types of languages? What do you think? |
|