I get a kick out of all the people who gripe about Python's "context sensitive whitespace" rigid structure. Have they never edited a .conf file which depends on line-by-line organization? Have they never seen a Makefile? Shell script? How about Prolog? FORTRAN? COBOL?

FORTRAN and COBOL are line-oriented languages because data used to be stored on punchcards. One punchcard is one line of text. FORTRAN reserves the first 6 columns of each line (card) for continuation markers, comment markers, and line labels. Everything has to be indented to the 7th column, unless you're using a modern loose derivative of FORTRAN. COBOL took that even one step farther, demanding certain indentation levels for nested conditions, and on some statements, a redundant NUMBERING which indicated how much indentation the line had.

It's not better or worse, it's just different. After so many token-stream languages like C, C++, PostScript, Java, Perl, SGML, you might get to think that that's the only normal way to code. No, it's just the current "in" thing to do with the current "in" parser tools. There are many other languages and file formats where the most natural way to read is line by line.

--
[ e d @ h a l l e y . c c ]


In reply to Re: Perl fan being tempted with Python by halley
in thread Perl fan being tempted with Python by jeyroz

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.