Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: 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:

  • 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


In reply to Re: Re: perl's forte by hardburn
in thread perl's forte by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found