There was a time when I knew everything about C++. I was amazed one time that Stroustrup himself wasn't sure if something was one way or another, and I reminded him that it had to be one way because of the way it all fit together.

That's the key: everything fits together with features' subtle points designed to lead to elegent combinations with other features, or the result of strict application of general principles.

I could know how some feature should work without reading the details, because I knew the general philosophy and concepts. When I did read it, that just re-enforced things, and I noticed anything that wasn't expected and remembered just that.

The example of a negative limit for split doesn't work this way. Through application of principles, you get either (1) a negative number is just another number, and a single simple statement of what that number does should handle all cases. Well, that's wrong since 0 is a special case and negative is a different special case. Or (2) it would count from the right instead of from the left, returning the last n values if you specified -n. Well, it doesn't do that either.

If you didn't look it up, you have no reason to suppose negative split limit does what it does, or even exists. It's an arbitrary factoid to remember.

The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).

—John


In reply to Re: On human memory management by John M. Dlugosz
in thread On human memory management by bronto

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.