[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: another take on hackers and painters
On Wednesday, May 21, 2003, at 10:04 AM, Dan Sugalski wrote:
> At 5:00 PM -0400 5/20/03, John Clements wrote:
>> On Tuesday, May 20, 2003, at 04:15 PM, mcguire@cs.utexas.edu wrote:
>>
>>>> Clerical programmers [...] will not know what to do with the freedom
>>>> given by things such as dynamic typing.
>>>
>>> Ok, so I'm none too bright. What exact freedoms do you get with
>>> dynamic
>>> typing? It seems like a type problem is going to result in a broken
>>> program either way, so you still have to think about types and making
>>> sure the right collection of stuff gets put in the right place. The
>>> only real advantages I can see are:
>>
>> ...
>>
>> Depends what you mean by "a type problem." If I'm adding a number
>> and a string, that's definitely a "type problem,"
>
> Is it? What's wrong with 1 + "3" producing 4?
Personal taste: I would much rather get the (static or runtime) check,
along with the ability to perform a dynamic coercion (string->number)
when I really want to take a string to a number.
Obviously, there's a broad spectrum here. I get the sense that
languages like Perl have a DWIM attitude, where any operation that can
be completed safely should be, whereas statically typed languages ML &
Haskell take the point of view that ensuring that every program
location corresponds to a single type is a crucial part of writing a
program.
As a Schemer (and of course I speak for no one but myself), I believe
in the utility of static type systems, but I also really like
heterogeneous lists, union types, object systems, non-let-bound
polymorphism, eval, and a host of other things that are difficult in
existing statically typed languages. Whenever I can get a check that
will rule out bad programs without preventing me from writing the
programs I want, though, I'm all over it. I would place this coercion
firmly in that camp.
john clements