Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
A number is never a sequence of bits. A number is an abstract ideal.

C and C++ represent a limited subset of numbers to the compiler as a sequence of bits, because sometimes it's worthwhile to burden the programmer for the benefit of the computer.

Perl represents data as containers around scalar values, and the language deals with the same scalar container holding different types of scalar values for the programmer. This is because it's often worthwhile to burden the computer for the benefit of the programmer. Perl does sometimes need a hint about how to treat a particular value, but usually the right thing just happens, and the Perl programmer can be more efficient in implementing a program because of that.

The issue of passing a Perl string to C or C++ is that C and C++ do not handle the automated data conversion that Perl does. They need the programmer to specify things for them for efficiency and automated type checking because that's the niche those languages were meant to fill.

That C and C++ don't handle a value that Perl handles quite well could as readily be seen as a weakness in those languages as in Perl, but it's really not a weakness of either. It's just a matter of working at two different abstraction levels. The C++ guy who's complaining would have to specify a type for his variables in C++ in the first place, whereas in this situation the type needs to be specified but not until it is about to be passed into C++. That he thinks that's retarded just shows his bias and no concrete advantage of one language overall over the other.


In reply to Re: Revealing difference in interpretation of 'number' between Perl and $other_language by mr_mischief
in thread Revealing difference in interpretation of 'number' between Perl and $other_language by w-ber

Title:
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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (6)
    As of 2014-09-01 22:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (17 votes), past polls