[Techtalk] Weak typing and type bugs (was Re: [Newchix] programming and females)

Mary linuxchix at puzzling.org
Thu Feb 21 11:25:13 EST 2002


Kathryn is right - replies to techtalk only please, I don't want to
swamp newchix with meta-programming discussion :-)

On Wed, Feb 20, 2002 at 04:48:19PM -0600, Kathryn Hogg wrote:
> We're getting alot beyond Newchix here but even 100% code coverage is
> insufficient because in a loosely typed language the effect of executing a
> particular branch of code is more dependent on the branches that preceded
> it.
> For example
> 
> if (some_condition)
> a = some_int;
> else
> a = some_list;
> 
> 
> if (some_other_condition)
> do_something_that_will_fail_if_not_a_list(a);
> 
> No error will occur unless some_condition is true and some_other_condition
> is true.  Any of the other three combinations of the two conditions will not
> generate an error.

I can't think of a valid reason to do this though. When I program in 
weakly typed langauges, I behave as if they're strongly typed, and don't
give a variable multiple types (object oriented "is a" relations aside).

Is there some advantage to the above that overcomes the bug-threat or is
it just sloppiness even though the language allows it?

-Mary.

-- 
Mary
<mary at puzzling.org>



More information about the Techtalk mailing list