One professor of mine stated that Perl was a low-level language because the following code snippet for reading lines from a file was fairly slow compared to other languages:
while ( my $line = <FILE> ) { # do something with $line }

Well that's completely nuts, and so out of touch with reality. For a start, the underlying IO system of any decent OS will fetch the disk blocks of the file into memory in advance, especially for a sequential read. And the C library will then fetch the file in chunks of 4096 bytes (or so) at a time, and dole out the bytes line-by-line.

And regardless of any fanciness the OS and C library and Perl IO layers try to do, I/O IS SLOW! It doesn't matter if your snipper is sub-optimal, because its slowness will be lost in the noise. I really fail to see the professor's point: that snippet abstracts away the concepts of hard disks and buffers quite well in my opinion. I must be missing something.

- another intruder with the mooring of the heat of the Perl


In reply to Re: Paul Graham on Great Hackers by grinder
in thread Paul Graham on Great Hackers by biosysadmin

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!
  • 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, details, 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, summary, 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.