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.
  • When I was working in the Great White North, I was working with a few Perl programmers that were thrown onto a Python+Zope project for the oddest of reasons. They were smart. They picked up Python without any difficulty. They learned how Zope wanted them to write and structure web apps, eventually.

    After a few months on the project, they had some interesting insights into the different world views of Perl and Python. A moderately experienced Perl programmer can skim over a random piece of Perl code and i
    • Great thoughts, as usual Ziggy.

      Therefore, any Python programmer of even the most basic skill level should be able to read any Python program (if not completely understand the underlying algorithm and data structures).

      Without being able to understand the program's design in the large or small, is being able to read the program even interesting? I can't think of a case where it is. Am I missing something?

      • Without being able to understand the program's design in the large or small, is being able to read the program even interesting?
        I think you're approaching the problem from the wrong direction.

        Given a new program and no previous understanding of how it works, you could read the program and build an understanding from there. Consider the first time you approached a full set of basic binary tree primitives, or a bubble sort. It may have been the first time you came across these concepts, but if you could read the code, you could understand what was going on without too much difficulty.

        Now, consider the first time you came across code for a balanced binary tree, an AVL tree, or quicksort. There probably wasn't enough information there for you to understand the algorithm completely, either in terms of how it worked or how it behaved (i.e. time/space performance).

        For a more pragmatic example, consider any of the programs from Matt's Script Archive. You may not understand what it is trying to do, but you can read it. If you've got more than a passing background in Perl, you'll probably find at least a dozen howlers before you understand the program. For a more mundane example, consider a program that passes everything through a magic regex. If you can read the regex, you can determine that it is a buggy RFC 822 matcher, and should probably be replaced, because no simple regex can email addresses. If you can't read the regex, then this is just a piece of cargo-cult code with magical properties.

        Reading a program without prior understanding is interesting because it is a gateway to gain that understanding. It's a necessary precondition, but not a sufficient one.

        I can't think of a case where it is. Am I missing something?
        Guido's right that readability is an important property, because if you can't read a block of code, you have no hope of understanding it. Consider quicksort written in APL or befunge. You may understand quicksort, but you wouldn't be able to find and fix a bug. Even Tony Hoare himself would have trouble.

        I won't speak for Guido, but a plethora of anonymous and interchangeable Pythonistas cite "readability" as if it were identical to "understandability". If this were the case, then Python indeed would have magic pixie dust, Chandler wouldn't be years behind schedule, and frameworks like Zope and Twisted wouldn't be so horrifically unapproachable.