Besotted With Static Type Checking

From CouldExtremeProgrammingHaveArisenWithoutSmalltalk:

ExtremeProgramming emphasizes the dynamic approach, especially feedback. It would be less likely to arise in a culture besotted with static TypeChecking. -- DaveHarris

Surely you mean a culture blessed with static type checking! Besotted is brilliantly pejorative here, which I enjoy, but it is not strictly accurate.

Take Java for example. JamesGosling, as JavaLanguage designer, might be viewed as being part of a culture that is besotted by static type checking. In fact I don't think the man behind the emacs VirtualMachine and LispLanguage-based scripting for it, or the failed NeWS display PostScript stuff can fairly be accused of that either.

But Java programmers have had StaticTyping foisted on them by Gosling, keeping up the pejorative mood. Methinks the man had his reasons. Were those reasons simply wrong? Even if they have some validity for some uses of the language, are they incompatible with or at least unhelpful to ExtremeProgramming in Java?

-- RichardDrake

You're probably being deliberately provocative, but that's still a bizarre way of describing the situation. Gosling has lots of experience with typeless, dynamic languages (the first EmacsLisp, Andrew, NeWS), gets frustrated with CeePlusPlus for a project he's working on, writes Java for his own project to suit his own tastes, releases it to keep it from dying, and lots of programmers get excited about it.

According to <http://www.artima.com/intv/gosling319.html>, Gosling he say:

"There's a folk theorem out there that systems with very loose typing [LooseTyping] are very easy to build prototypes with. That may be true. But the leap from a prototype built that way to a real industrial strength system is pretty vast. By and large, I wasn't really concerned about how quickly you could slap together a demo. I was much more concerned about how quickly you could build a real system. And boy, strong typing [StrongTyping] is a great thing there. Anything that tells you about a mistake earlier not only makes things more reliable because you find the bugs, but the time you don't spend hunting bugs is time you can spend doing something else."

In other words, nobody's told him about UnitTests yet.

Sure, first assume all UnitTests have 100% coverage and are all perfectly written, and anyone expanding or using the library also writes complete and perfect unit tests. Don't need typing then, no sir. My own beef with dumb StaticTyping systems (like JavaLanguages?'s and CeePlusPlus) however is that they tend to create stovepipes wherein developers get locked into using certain types and have to create adaptors which either effectively violate encapsulation (that is, keeping related data together) or are themselves locked into another type system. Interface types are of scant help in this regard, since they have to be thought up beforehand. Structural inference is a big help, which only locks you into the names of labels, but otherwise allows methods to vary. For a similar reason, GenericFunctions are also nice for overcoming type lock-in, since you can effectively extend them ad hoc without having to revisit the whole interface. Throwing out static TypeChecking however is ridiculous; the compiler has proved that you're using the type incorrectly, why not listen to it? If you don't like having to annotate everything with types, that's a problem of a stupid compiler, not StrongTyping. Demand better from your compiler and language.


Yep. He foisted it on us. No question. -- GlennVanderburg

No he didn't. According to your description of events "lots of programmers" did. To think someone on Wiki would suggest that I of all people would be deliberately provocative. Surely after all I've ever said you know that my motto is only ever "LetThePeopleDecide". -- RichardDrake

[For Americans only: the last paragraph must be read with an IronyWarning.]


If this really was my view, would it be the WikiWay to overwrite besotted with blessed or perhaps 'blessed'? I think not but the question raises profound issues for me on the UltimateTestForJointOwnership. -- RichardDrake

No. To change the word would be to change the meaning of the original posting. One improves clarity but doesn't change the point.

Thanks. It took a major refactoring ten months later to receive an answer to this question, asked in my first ten days of Wiki. I agree with your answer... for now!

"Surely you mean blessed" Not really. Committed or Wedded would be closer. Subsequent writers have given the word I used more negative connotations than I intended, and of course the extrapolations about Gosling and foisted are not mine. -- DaveHarris

ThankYou for the refactor and the excellent clarification. I now agree more with the use of the word besotted for JavaLanguage than I did ten months ago, from further hands-on experience in a team of Java experts! I respect your original point more as a result, but it's hard to squeeze that evolution of my own view into the original page!

I am now the culprit who has made besotted part of a WikiName, from which there is no one-step edit or delete.

Am I the only one who thinks Wiki would be boring without points being made in a punchy way with colorful words like this? Doesn't it often (not always) lead to better discussion and discovery of issues? Should all the discussion above simply be refactored into Dave's original sentence with committed or wedded and put back into the original page?

Human language and discourse is surely richer than that!

-- RichardDrake


StaticTyping sucks because I always have to stop and figure out what type some dumb variable is before I can just use it! -- PhlIp

Son, you are just wrong.

Please don't be too easy to bait ;-> -- PhlIp

And without static typing, you don't have to stop and figure out what type of data some dumb variable might be holding at that point in the program before you can use it? -- DanMuller

Exactly. I should be able to find the square root of a string. -- V

So what's the square root of "asdf"?

"asdf" is not a square. "asdfasdfasdfasdf" is, and its square root is "asdfasdf".


This seems to have degenerated into a standard StaticVsDynamicTyping HolyWar. Perhaps we should merge it with an existing topic on such rather than reinvent the wheel.


See ExtremeProgrammingWithTypes and DoesXpWorkForJava for some answers.


CategoryLanguageTyping


EditText of this page (last edited September 7, 2006) or FindPage with title or text search