Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Just read "How OOP is like Japanese food". Burke says: These are both bad things, and even wanting them is a sign that everything is just wrong. And the OOP equivalent of those danger signs is, of course, iterators. [Except in streams!] He does not go on to substantiate this comparison. I would like to hear any justification for this opinion.
    Yet another JAPH
    • Yes. This is very confusing, partially because the term iterator is overloaded.

      On the one hand, it's a C++ bastardization of a general concept, where every relevant class has *, ++ and -- overloaded so you can do things like use generic sort functions with your class (regardless of how the aggregate structure in your class works internally).

      On the other hand, there's the source of that general concept in the Lisp world, where an iterator is nothing more than serialized access to some abstract sequence

    • I was bitter about a run-in with a horrible system that couldn't be bothered to return a simple list (because lists aren't OOey! so say the VOICES!) and so returned an iterator object. So it was real ugly to deal with, instead of how pretty a simple foreach($thing->woozewuzzle) would have been.

      I think that's what I meant.

      Montreal was in the middle of an unliveable heat wave, so as I was giving that talk, I could barely stand up from heat exhaustion. Global warming is fun!! [nytimes.com]

      • Heh. But $thing->woozewuzzle->loop(sub {...}) isn't exactly tricky.

        Let me guess; that's not the kind of interface the thing provided.
        • Not tricky, but uglier than sin. That kind of nonsense is what happens when your language implemented OO with the 80/20 rule. Cleanly integrating iterators was the 20/80 that didn't get implemented.

          --Nat

          • Point. This is where Smalltalk syntax starts to win:
            aCollection do: [ :each | each someMethod ]
            Should look lots nicer in Perl6 too:
            $a_collection.do({.some_method })
            Hmm... I wonder if you'll be able to dispense with the parentheses there...
      • IIRC, Win32::OLE solves this for OLE collections by providing a method "in", which enables you to write

        foreach $elem (in $coll) {...}

        which also resembles the Visual Basic For Elem in Coll(?) syntax, making it a bit easier to port VB code (e.g. in interface docs).

        --
        .e'osai ko sarji la lojban .i mi klama le zarci
    • You may be interested to read Henry Baker's excellent paper Iterators: Signs of Weakness in Object-Oriented Languages [plover.com]. The quick summary: If C++ had had a decent type system with reasonable polymorphism (like Perl arrays) or if it had had decent higher-order functions (like Perl map) then all this yah-yah about 'iterators' would be completely unnecessary.

      Henry Baker is one of those people where you should pay close attention to everything he says because he's nearly always right. What is it about pe

  • No-one that was there can forget the Lighting Talk That Shall Not Be Named (at least around the Python folks anyway). It's been two years, and we're still waiting for a transcript. :)
    • You missed the part where gnat explained (as if it ever needed explaining) that That Talk Shall Never Be Transcribed Publicly.
    • But there have been repeat performances. I've seen two. One at YAPC::Europe 2000 and an unforgettable performance at about 3am in the foyer of the Doubletree Hotel in Monterey at OSCON 2000.

    • A fan! Thanks! Tell you what--if Python's still around in 2005, I'll do it again. That was a lot of fun to do, but I'm worried that the more I do it, the more chance there is that someone will realize I'm just talking shit :-)

      --Nat

  • Similarly, if you're writing an Atari 2600 emulator, I don't way to hear the word "object" mentioned, even in jest!

    I have a sudden, almost uncontrollable urge to write an object-oriented Atari emulator in Perl.

    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
  • A sneak preview 2002 lightning talk: CPAN is unusable [omor.com] is posted. dc
    --
    dc
    • Well, OK... The main problem with CPAN, as perceived by this Anonymous User, is that it isn't clear that the actual download link is in the top section, next to the label "Latest Release"; and that the links in the bottom sections all point to documentation.

      (See slides 3 and 4)

      I'd propose an extra header bar above the bar "Modules", and that a header "Download" is added above the label "Latest Release".