Don't ask to ask, just ask | |
PerlMonks |
Re: Re: perl's forteby hardburn (Abbot) |
on Mar 19, 2004 at 17:39 UTC ( [id://338077]=note: print w/replies, xml ) | Need Help?? |
Forget all the stuff about "strictly typed languages" etc Perl is strongly typed. It just have "types" in the way most programmers are used to. '$' denotes a scalar type, '@' an array type, and so on. It is very strong (there's no way to transform an array into a scalar, for instance) and behaves in a way that most programmers would expect it to (what would an array transformed into a scalar look like, anyway?). For the record, when speaking of type systems:
These are really seperate concepts, and I wish completely different terms were used to describe them. The LHS is generally done at compile time, while the RHS is generally done at runtime. Strong vs. Weak deals with weather your language lets you transform one type into another. In C and Java, you can transform an int into a float through a simple cast, so they're reltively weakly typed. They also require you to explicitly define the type, so they're strictly-typed languages. Which is an annoying combination, because type errors and warnings are just as likely to be real problems as they are to be mere annoyances. See also: Strong Typing and Perl by MJD. Very enlightening presentation. It demonstrates that if you're going to have a type system, don't do it half-heartedly like C and Java do. Not only that, but a truely strong type system (such as in ML) can have a lot of benefits without the problems normally associated with them. ---- Note: All code is untested, unless otherwise stated
In Section
Meditations
|
|