Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Adding to what Ovid noted above, I think the original post makes a huge mistake in trying to compare dynamic languages to languages with C-style static typing that's been absorbed into many other languages (C++, Java, C#, etc.).

When comparing C-style typing to Perl/Ruby/Python/flavor-of-the-month dynamic language, dynamic languages usually win. If we add verboseness to the language (in this case, declaring types), it should give us something in return. The claimed return is speed (compiler has more information to perform optimizations), safety (compiler has more information on what you're trying to do and can see if you're doing something that doesn't make sense, like taking the square root of a string), and self-documentation.

These days, the additional speed is better handled by simply throwing hardware at the problem or finding optimizations elsewhere when they're needed. If this were the only argument for C-style typing, then it would rarely be enough to overcome the cost of additional verboseness. The argument for speed was a valid one when Richie and the gang were writing UNIX, but today, hardware is usually cheaper than developer time.

The safety argument is outright bunk for this style of typing. Type errors in C are just as likely to be minor annoyances (requiring a typecast, which further increases verboseness) as they are to be real problems. The false-positive rate is high enough that programmers are likely to treat all type errors as annoyances. C++/Java/C# make these problems somewhat less likely, but the type system still gets in your way more than it actually helps.

Self-documentation is a weak argument. The additional verboseness is there for the compiler's benefit, not your's. While there might be some benefit here, I can't see it being a replacement for real documentation or good coding practices.

Therefore, the arguments for C-style static typing over Perl-style dynamic typing are weak at best, and I can't take people seriously who try to compare these two possibilities.

I can take people seriously who compare languages with strong type inferencing systems (Haskell and Ocaml) against dynamic languages. These languages demonstrate the safety value of strong type systems (type errors are almost always real problems), and aren't even particularly more verbose than dynamic languages. People who are still gripping to C-style typing have rarely explored these alternatives.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

In reply to Re: Interesting read: "Why I use perl and still hate dynamic language weenies too" by hardburn
in thread Interesting read: "Why I use perl and still hate dynamic language weenies too" by ghenry

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (5)
    As of 2020-07-09 20:03 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found