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 immediately tell if it's total crap (a la Matt's Script Archive), intentionally obfuscated, unintentionally obfuscated (influenced by misguided style guides), moderately good, well-written and crystal clear, seriously clever for good reasons, or drunken code. I think that pretty much covers the gamut.

    On the other hand, Python is intentionally and proudly optimized to be readable by beginners. 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). The unintentional side effect is that a moderately experienced Python programmer needs to read, rather than skim, each and every Python program he picks up to determine if it's total crap, moderately good, well-written and crystal clear, clever for good reasons, or written while drunk.

    Since then, I've heard stories of projects like Chandler, where the Python code is seriously unpythonic, and written in the early days by C++ programmers who coded as if Python were an interpreted dialect of C++. In these cases, it seems that it's even more difficult to discern what a Python program does, since you need to read more deeply into the code to get to the moment when you ask yourself what on Earth were they thinking? before you reach enlightenment, trace through the execution paths before seeing how to rewrite ~1000 lines of C++-in-Python with ~30 lines of more reasonable, idiomatic Python.

    There is no 'good' or 'bad' here. There are just choices with desired properties and unintended consequences.
    • 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 r

    • The unintentional side effect is that a moderately experienced Python programmer needs to read, rather than skim, each and every Python program he picks up to determine if it’s total crap, moderately good, well-written and crystal clear, clever for good reasons, or written while drunk.

      That’s how I feel about Java. Regardless of how crappy the code, it always looks reasonable on a microscopic level.