Folks - the following message was posted by Ron Jeffries on the eXtreme Programming mailing list. There's been a small thread over there about static typing. This was his response. Dave From: Ron Jeffries <ronjeffries / acm.org> Subject: Re: [XP] What's wrong with strict typing? At 12:28 AM 6/17/2000 +0400, Pavel A. Perikov wrote: >Reading comp.object I gotta impression that XP doesn't generally >encourage strict typing. Smalltalk & Python is good, C++ sucks :) Is >there any [semi-] official XP statement about strictly typed languages >such as C++ (putting away other major drawbacks), Java, Eiffel etc? I'm about as semi-official as you can get. XP isn't language specific, although the things you have to do need to be adjusted. Strictness of typing isn't one of the issues, although the language contortions it takes to support strict typing may be. Strict-typing languages like C++ and Java induce you to declare something in one place, then define it in another, then use it in a third. They generally won't let you use something before you go somewhere else first. It's a bit like having to pitch your tent every night before going to bed. It worked well for the nomads but it's not terribly efficient. In addition, most implementations of these languages are compile-link-run in nature, rather than incremental compilers. This isn't necessary, but it is the way things turned out. The effects of these characteristics are that (a) you have to edit in more places to do any given refactoring, and (b) as your program grows, it takes longer to install a change and test it. The non-strict languages, such as Smalltalk and LISP and, yes, Python, throw up fewer of these obstacles. If refactorings allow you to change less code, refactorings are easier, quicker, less error-prone. If you can move from change to test in one second instead of 1 minute, you can make smaller changes, again reducing error. In Smalltalk, there are some additional advantages. The ordinary Smalltalk browsers let you find and access things in ways that Emacs people can't even imagine. (Yes, I know, you can grep your source files. Smalltalk actually knows what it's looking at.) Even better, the Refactoring Browser actually knows how to DO the refactorings for you. It's a power tool for refactoring. Languages like Smalltalk and LISP have yet another advantage. These languages are written in themselves. They are reflective, which means that there are Smalltalk or LISP statements that can manipulate the running code. This is a good way to kill yourself, but it also means that you can extend the programming environment when you need to. This isn't something for beginners, but it means that you can acquire powerful and valuable tools from experts, and integrate them into the IDE with ease. This, too, used with good judgment, speeds your programming. The cumulative effect of all this is that a competent programmer in these languages can go faster than an equivalently competent programmer in the strict languages. Part of it is due to the cost of strictness, part to the toolset. So ... XP is easier to do in Smalltalk or Python than in C++. It's still quite doable in C++, just not as fast and not at such a small increment of change. Bottom line: There's nothing "wrong" with strict typing languages. It happens that they don't provide the most productive development environment - arguably for many things, and certainly for XP practices like refactoring and test-first design. Just my opinion, of course ... but I believe a fairly expert one. And semi-official to boot. Ronald E. Jeffries http://www.XProgramming.com "This path has been placed before you, the choice is yours alone."