[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: "stereotyping"

Austin Ziegler

11/21/2003 6:45:00 AM

On Fri, 21 Nov 2003 10:33:39 +0900, Clifford Heath wrote:
> Your comments on refactoring are well-taken, but I feel would be
> solved better by better tool support in a more strongly-typed
> language. To safely refactor in any language, you must be
> confident of limiting side effects. A dynamic language just makes
> side effects will occur at runtime instead of compile time - and
> if your test suite doesn't give very high code coverage how will
> you know that the system can be released. Remember, you can't just
> patch it after it's in production because it's not just one local
> customer, it's dozens.

Um. Sorry, but type signatures don't promise you that side effects
are limited to compile-time. Only testing will do that. Which brings
you right back to the advantages of dynamic languages as opposed to
static type signatures.

-austin
--
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.11.21
* 01.43.11


1 Answer

Clifford Heath

11/21/2003 8:09:00 AM

0

Austin Ziegler wrote:
> Um. Sorry, but type signatures don't promise you that side effects
> are limited to compile-time.

That's true, but they help by catching some cases. Said cases are
more likely to occur in some programs and human environments than
others. Whether Ruby should be used in environments where these
errors are common and avoidable seems to be the main bone of contention.
Optional typing (whether static, dynamic, or some combination) would
increase the range of purposes for which Ruby is suitable. You might
not want that, but I do.

> Which brings you right back to the advantages of dynamic languages
> as opposed to static type signatures.

No it doesn't. It leaves you with no guarantee, but more confidence.
But there are no guarentees anyhow - even if the software works as
designed, nothing says it meets the user's need. Nothing's certain in
life, instead we must live within certain confidence levels. Static
typing can improve confidence levels. So can thorough testing.
Nothing about the absence of static typing can yield these particular
improvements - though individual languages may have (mostly) unrelated
other features which do, including reduced verbosity.

Clifford.