Anonymous
Unregistered
|
|
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."
|
Anonymous
Unregistered
|
|
Agree - and one more data point - Robert C Martin - long an advocate of the rigid static typing found in C++ has apparently had a change of heart.
Quote:
I've been a statically typed bigot for quite a few years. I learned my lesson the hard way while using C. Too many systems crashed in the field due to silly typing errors. When C++ came out, I was an avid adopter, and rabid enforcer of strong typing. ... About two years ago I noticed something. I was depending less and less on the type system for safety. My unit tests were preventing me from making type errors. The more I depended upon the unit tests, the less I depended upon the type safety of Java or C++ (my languages of choice).
I thought an experiment was in order. So I tried writing some applications in Python, and then Ruby (well known dynamically typed languages). I was not entirely surprised when I found that type issues simply never arose. My unit tests kept my code on the straight and narrow. I simply didn't need the static type checking that I had depended upon for so many years.
The source is here: Are Dynamic Languages Going to Replace Static Languages?
More and more Java begins to look like a language built on false premises.
|
Anonymous
Unregistered
|
|
You are confusing strong/weak typing with static/dynamic typing. Smalltalk, Python, Ruby are all strong, dynamically typed languages. C++ is a weak, statically typed language. Java is a strong, statically typed language.
|
|