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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Second order effects of language syntax (Score:2)
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
Re: (Score:1)
Great thoughts, as usual Ziggy.
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?
Re:Second order effects of language syntax (Score:2)
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.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.
Reply to This
Parent