Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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 vrk

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 all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (4)
    As of 2017-12-16 15:53 GMT
    Find Nodes?
      Voting Booth?
      What programming language do you hate the most?

      Results (455 votes). Check out past polls.