First off, note that the whitespace silliness isn’t the foremost reason I just can’t like Python, but it sure is a constant irritation. Why?

When I am rearranging my code, I generally cut and paste sections together as I see fit.

With Perl, I use Vim’s = command on the entire section and the indentation is magically cleaned up in one fell swoop.

With Python, I use Vim’s = command on the entire section and have a veritable mess on my hands. No can do. I need to pay close attention and reindent everything immediately upon pasting.

Basically, the difference is that you can indicate the nesting structure of a piece of code by asserting it with one visible extra character every dozen lines or so and let the computer work out the formatting from that; or you can specify the nesting structure of a piece of code by re-asserting it on every single line with multiple invisible characters and be unable to request any help with it. I thought computers were supposed to automate dronework.

I shuffle code around often enough that it matters to me: I generally postpone structuring code until I’ve written it and can see which parts do what – what lends itself to extraction into subroutines, whether some functions can be inlined, etc. In a way, I let the code suggest its distribution of responsibilities to me. Perl just lets me be as sloppy as I deem fit. Python doesn’t trust that I’ll be disciplined when it counts.

That’s a general trend which extends to a lot of other details. In expressive power and conciseness, the languages are neck to neck, but writing Python feels like work.

Makeshifts last the longest.


In reply to Re^3: Perl or Python? by Aristotle
in thread Perl or Python? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.