Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: perl's forte

by hardburn (Abbot)
on Mar 19, 2004 at 17:39 UTC ( [id://338077]=note: print w/replies, xml ) Need Help??


in reply to Re: perl's forte
in thread perl's forte

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:

  • Strong != Strict
  • Weak != Dynamic

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://338077]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-24 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found