Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 958324

Anonymous
Unregistered




Static typing beneficial?
      07/28/03 08:01 AM

The author writes "Note: Java also provides static type checking, which Smalltalk lacks. Although static type checking is widely regarded as beneficial, most Smalltalk developers argue against it."

This assumption has come under fire lately. Many strong typing advocates have come around to the realization that strong typing is not as beneficial as first thought and in fact has a heavy cost and dynamically typed languages are a better tradeoff. Bruce Eckel author of Thinking in Java has come around to this viewpoint (see here http://mindview.net/WebLog/log-0025) "To claim that the strong, static type checking constraints in C++, Java, or C# will prevent you from writing broken programs is clearly an illusion (you know this from personal experience). In fact, what we need is

Strong testing, not strong typing.

So this, I assert, is an aspect of why Python works. C++ tests happen at compile time (with a few minor special cases). Some Java tests happen at compile time (syntax checking), and some happen at run time (array-bounds checking, for example). Most Python tests happen at runtime rather than at compile time, but they do happen, and that's the important thing (not when). And because I can get a Python program up and running in far less time than it takes you to write the equivalent C++/Java/C# program, I can start running the real tests sooner ... Robert Martin is one of the long-time inhabitants of the C++ community. He's written books and articles, consulted, taught, etc. A pretty hard-core, strong- static type checking guy. Or so I would have thought, until I read this weblog entry. Robert came to more or less the same conclusion I have, but he did so by becoming "test infected" first, then realizing that the compiler was just one (incomplete) form of testing, then understanding that a weakly-typed language could be much more productive but create programs that are just as robust as those written in strongly-typed languages, by providing adequate testing."

Paul Graham expresses it really well in an essay Hackers and Painters http://www.paulgraham.com/hp.html

"A programming language is for thinking of programs, not for expressing programs you've already thought of. It should be a pencil, not a pen. Static typing would be a fine idea if people actually did write programs the way they taught me to in college. But that's not how any of the hackers I know write programs. We need a language that lets us scribble and smudge and smear, not a language where you have to sit with a teacup of types balanced on your knee and make polite conversation with a strict old aunt of a compiler."


Post Extras Print Post   Remind Me!     Notify Moderator


Entire topic
Subject Posted by Posted on
* Static typing beneficial? Anonymous 07/28/03 08:01 AM
. * * Re: Static typing beneficial? Anonymous   07/29/03 07:26 AM
. * * Re: Static typing beneficial? Anonymous   07/28/03 12:08 PM

Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   



Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 10916

Rate this thread

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5