> Exactly- the statically typed languages I am familiar with have a casting
> mechanism to utterly subvert compile-time type checks. While static typing
> allows better compile-time optimization, it's value as a debugging
> mechanism is near the bottom of the list of advantages for engineering
> a large project.  If interface guarantees are important between Perl
> objects, I'd have a look at Class::Contract.

One nice thing about which is that the "contract" portion can be
essentially turned off in production. Gives you the best of both
worlds: strong checking during development w/ good speed in productin.

>
>> > Compile time checking can definitely be a friend of yours especially
>> > when dealing with large systems. But it's also a friend that's
>> > judgemental (strongly typed) so he's a pain to drag along to a
>> > party....
>>
>> To me, strongly vs weakly typed is less descriptive than statically vs
>> dynamically typed.
>
> To me, it is utterly nondescriptive in a PHB buzzwordy way, whereas
> static vs. dynamic typing is meaningful (and what I think most people
> really mean by the former).

Comparing Perl to other OO languages runs into the fact that
only Perl uses a fairly high-level object as its basic storage
unit (scalar). The first thing most people write/buy for the
strongly typed languages is a library of contaner classes: things
that subvert the strong checking of low-level types. The second
thing that usually happens is that the low-level types get their
base operations overloaded via container objects.

Net result is minimal -- at best -- type checking.

The problem isn't really that scalars are weakly typed, since
all you can deal with are scalars. If programmers bothered to
write checks in their code (e.g., $foo =~ /^\d$/ or croak "NAN")
then Perl will do as well or better than most languages. Coders
are too used to having the low-level type checking around as
a crutch, so they don't. Implementing code that uses Class::Contract
forces you to declare [perhaps even analyze?] not only data types
but expectations, and ends up causing people to do a much better
job of checking then most other languages even allow.



--
Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 800 762 1582

Reply via email to