http://www.perlmonks.org?node_id=1211185


in reply to Re^4: Hash key composition with a comma?
in thread Hash key composition with a comma?

An example, AKA proof, is actually necessary when one makes an assertion in the sciences.

Firstly, examples are not proofs "in the sciences" unless they are counterexamples.

Secondly, this is misplaced pedantry. It really is quite obvious that, when you rely on metacharacters, your data had better not inadvertently include them. This is not an assertion that needs to be proven to anybody with a modicum of programming experience. AM was entirely correct on that point.

I'll agree that AM's admonition against using the feature was hyperbolic. Sometimes it is better to avoid the pitfalls of some language feature than it is to avoid the feature itself. And we are entirely capable of doing so. (As Rolf points out.)

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re^5: Hash key composition with a comma?

Replies are listed 'Best First'.
Re^6: Hash key composition with a comma? (updated)
by LanX (Archbishop) on Mar 18, 2018 at 13:46 UTC
    > Firstly, examples are not proofs "in the sciences" unless they are counterexamples

    Yeah, but effectively that's what Your Mother was asking for, a counterexample for the thesis that multidimensional hashes are safe.

    Hence a "proof" according to you. ;)

    update

    to elaborate more: every example proofs something, but not every proof needs an example.

    Or in formal notation:

    Example => Proof

    So of course YM's "aka" is not correct in mathematics.

    But in IT it's important to see how likely a problem is, because nothing is without risk.

    For instance the same problem might be easily solved with multidimensional keys, where hashes of hashes have a higher risk to run out of space or to be vulnerable of bugs because of higher algorithmic complexity.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery

      Yeah, but effectively that's what Your Mother was asking for, a counterexample for the thesis that multidimensional hashes are safe. . . . So of course YM's "aka" is not correct in mathematics.

      Your first point is well-taken, but yes, it was the "AKA" that prompted me to underscore the difference.

      I might not like gratuitous pedantry, but that's only when others do it. ;-)

      -sauoq
      "My two cents aren't worth a dime.";
Re^6: Hash key composition with a comma?
by Your Mother (Bishop) on Mar 18, 2018 at 14:29 UTC

    The reason I asked is because it's sundialsvc4 posting anonymously and inexpertly again. He absolutely could not demonstrate what you suggest. That's the point of asking him. One does not get to say, this is trivial and then substitute handwaving for technical details. An anonymous-hat-monk called me out once when I said something was semi-trivial so I backed it up because I know what I'm doing and while I'm just as in love with the sound of my keyboard as the ruler of Worst Nodes I'm also interested in helping others. This is not only a site for the competent hackers you imagine. It's also a site for beginners and knowledge seekers. Explicit examples like choroba and LanX produced serve the monastery infinitely better.

    I have said many, many times SunnyD is often half right and that allows others to read into the wrong half and make assumptions or contortions or edge-cases to make it right. But half a cup of poison is still a problem and I am going to continue to slap it out of his hands when he offers it.

      I'm not sure it's him, he doesn't have a monopoly on half-truth and this stupidity has a slightly different flavor.

      Anyway continue to "slap it out"! :)

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Wikisyntax for the Monastery

      I don't know who posted it. But the content stands on its own. And what he said about the pitfalls was true even if his estimate of the danger was overblown.

      Yes, this is a place for beginners as well as competent hackers. And I agree that examples are better. But they aren't always necessary and not providing one isn't really cause for a berating, particularly on fundamental points. And if a beginner doesn't understand and would like an example, he could always ask for one, right? I assume you didn't actually need one and I question your attempt to test the AM.

      Not that any of this is as important as we are making it. You have a stated dislike for anonymous posting; I have a stated dislike for gratuitous pedantry. I think this thread brought up each of our pet peeves.

      -sauoq
      "My two cents aren't worth a dime.";
        …not providing one isn't really cause for a berating, particularly on fundamental points…

        This was my original request–

        Perhaps you could show how such a legacy code trap might work. Some code to demonstrate the issue.

        It's cromulent and it would have taken less effort to demonstrate for someone who knows any Perl than to go on and on about how it's clear to everyone. And regarding particularly on fundamental points, just no. Flat Earth is a thing. Complete disbelief in evolution is a thing. And hackers who put passwords in query strings or cookies, can't understand the most basic properties of numbers or data structures, and cause multi-million dollar breaches of data are most definitely a thing. As I said, if you or pretty much any named monk here had done the post, I wouldn't have objected, except perhaps to say, as you said, the urgency was hyperbolic. Twenty years in mostly on legacy Perl I never saw the problem once. As LanX said, there is some context lacking and probably I'm overly aggressive with the situation—syphilis recently called me out on it and was quite right—but I'm 100% done with that monk or anyone unidentifiable who sounds like him.

        Hi saouq

        > I don't know who posted it.

        You haven't posted since 2015 and might not know how damaging the workings of certain monks have become.

        So please be tolerant of some reflex answers...

        > I question your attempt to test the AM.

        I welcome it, because finding an example highlighted that this "meta-character problem" is far less dangerous than the usual ones.

        There are far too many dogmatisms in IT which need to be questioned.

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Wikisyntax for the Monastery