From: Aaron Sherman <[EMAIL PROTECTED]>
   Date: Tue, 22 Feb 2005 18:49:36 -0500

   On Tue, 2005-02-22 at 17:38, Ranga Nathan wrote:
   > Here is an email I received internally regarding the shortlist of 
   > languages for future software development. I must add that this is a 
   > corporate environment. I responded saying that Perl has one of the richest 
   > data structures that I know of. Strong typing is actually a bad thing as 
   > far as I am concerned. How can I rebut this arguement in a better way? 
   > Actually, there is a hidden agenda to standardize on C# here!

   On Type Safety and Perl

   First, let's start with a definition. This one comes from answers.com:

           http://www.answers.com/type-safety&r=67
           In computer science, a programming language is type safe when
           the language does not permit the programmer to treat a value as
           a type to which it does not belong.

   In Perl, there is one data type and two containers. The data type is
   called "scalar". In so far as the definition goes, Perl is a type safe
   language, since you can never treat a scalar as a "not scalar" in Perl.

   Of course, what type safety is SUPPOSED to mean is that you have a
   semantic hierarchy of types, and each one has some particular definition
   which prevents abuse of that type . . .

   The type safe programming languages instead force you to pre-declare
   that a variable is a "string" or "integer", and then to invoke a
   function or method which explicitly converts one to the other, and thus
   adding "five" to 10 would result in a compile-time error in most cases.

This conflates "type safety" with "static typing"; type checks can also
be done at run-time, so these two language characteristics are not only
distinct, they are independent.  The classic dynamic language is Common
Lisp, which has a rich type hierarchy, and is type-safe by default
(i.e. without type declarations, which are always optional) but is
dynamically typed.  You don't ever have to say that a given variable is
a string or integer, but if you try to add or concatenate a string and
an integer, you will get an error at run-time.  You may even get a
compile-time warning if the compiler can infer the argument types from
context.

   Unfortunately, someone who doesn't like Perl is probably going to
really hate Common Lisp . . .

   . . .

   Conclusions

   Type safety is a powerful tool, but to confirm that high quality code
   can be written and maintained without type safety, one need only look at
   the CPAN repository where Perl modules and add-ons are stored. In this
   repository everything from genetic modeling software to Web server
   management tools to protocol implementations to graphics toolkits is
   managed by contributors and authors.

CPAN would be helped by dynamic type safety.  It probably owes its large
size to the lack of static typing.

                                        -- Bob Rogers
                                           http://rgrjr.dyndns.org/
 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to