do people really complain about significant whitespace?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • infidel

    do people really complain about significant whitespace?

    Where are they-who-hate-us-for-our-whitespace? Are "they" really that
    stupid/petty? Are "they" really out there at all? "They" almost sound
    like a mythical caste of tasteless heathens that "we" have invented.
    It just sounds like so much trivial nitpickery that it's hard to
    believe it's as common as we've come to believe.

  • Jason

    #2
    Re: do people really complain about significant whitespace?

    infidel wrote:
    Where are they-who-hate-us-for-our-whitespace? Are "they" really that
    stupid/petty? Are "they" really out there at all? "They" almost sound
    like a mythical caste of tasteless heathens that "we" have invented.
    It just sounds like so much trivial nitpickery that it's hard to
    believe it's as common as we've come to believe.
    I have a coworker who dislikes Python for the whitespace. He likes the
    idea that if someone is silly enough to put a whole program on one
    line, they can put it back together by following the braces. He also
    likes that the compiler can compile the program even if a normal person
    can't read it.

    I've pointed out that we format our code with the whitespace anyway.
    He points out that if some code gets accidentally dedented, it is
    difficult for another programmer to determine which lines were supposed
    to be in the indented block. I pointed out that if someone
    accidentally moves a curly brace, the same problem can occur.
    Anecdotally, I've never had either problem.

    Sadly, people who do dislike the whitespace do exist. I have also
    talked with several other programmers who were very turned off about
    the white-space thing and wouldn't give the language a chance.

    Eric S. Raymond wrote enthusiasticall y about Python, but was initially
    turned off by the whitespace rules. (See
    "http://www.python.org/about/success/esr/" for details.)

    I personally love that my logically formatted code imparts information
    logically to the language.

    (I haven't seen a good hate-us-for-our-whitespace thread go on for
    awhile. I do remember some good "We like Python, Now Add Our Favorite
    C/C++/LISP/INTERCAL Features or We'll Leave" threads on this newsgroup.)

    Comment

    • crystalattice

      #3
      Re: do people really complain about significant whitespace?

      infidel wrote:
      Where are they-who-hate-us-for-our-whitespace? Are "they" really that
      stupid/petty? Are "they" really out there at all? "They" almost sound
      like a mythical caste of tasteless heathens that "we" have invented.
      It just sounds like so much trivial nitpickery that it's hard to
      believe it's as common as we've come to believe.
      Actually, some of the guys I work with complained about Python when
      they first had to learn it for our Zope server. One of them is an
      old-school Unix guy who spent the last 20+ years doing procedural
      languages with funky syntax, like C. The other one is a VB.NET junkie
      who I don't think has much experience outside of MS languages, except
      maybe Java.

      One of the complaints they had for the first few weeks was the white
      space issue and the fact Python doesn't have brackets or semicolons.
      Obviously they learned to "deal with it" but they sure made it seem
      like it was a painful transition. I think the biggest pain was the
      fact that they are forced to indent their code now so they can't be
      lazy anymore.

      Comment

      • John Machin

        #4
        Re: do people really complain about significant whitespace?


        infidel wrote:
        Where are they-who-hate-us-for-our-whitespace? Are "they" really that
        stupid/petty? Are "they" really out there at all? "They" almost sound
        like a mythical caste of tasteless heathens that "we" have invented.
        All societies demonise outsiders to some extent. It's an unfortunate
        human (and animal) trait. In some societies, this is directed from the
        top. Very fortunately, this is AFAICT not the case in the Python
        community.
        It just sounds like so much trivial nitpickery that it's hard to
        believe it's as common as we've come to believe.
        So just block your ears when the propaganda vans with the loud-speakers
        on top drive past your dwelling :-)

        ............... ............... ..........

        However, meaninglessly significant whitespace at the *other* end of a
        line can be annoying:

        #>>a = \
        .... 1
        #>>a
        1
        #>>b = \
        File "<stdin>", line 1
        b = \
        ^
        SyntaxError: invalid token

        Huh? Can't see what the problem is? Maybe this exaggerated example may
        help:

        #>>c = \
        File "<stdin>", line 1
        c = \
        ^
        SyntaxError: invalid token

        Cheers,
        John

        Comment

        • bearophileHUGS@lycos.com

          #5
          Re: do people really complain about significant whitespace?

          Jason wrote:
          He points out that if some code gets accidentally dedented, it is
          difficult for another programmer to determine which lines were supposed
          to be in the indented block. I pointed out that if someone
          accidentally moves a curly brace, the same problem can occur.
          I like significant whitespace, but a forum, newsgroup manager (like
          Google Groups in the beginning), email management program, blog comment
          system, etc, may strip leading whitespace, and it usually doesn't
          "move" braces. A language (like Python) doesn't exist alone in vacuum,
          it exists in an ecosystem of many other programs/systems, and if they
          don't manage leading whitespace well, such language may have some
          problems :-)

          Bye,
          bearophile

          Comment

          • Jason

            #6
            Re: do people really complain about significant whitespace?

            bearophileHUGS@ lycos.com wrote:
            Jason wrote:
            He points out that if some code gets accidentally dedented, it is
            difficult for another programmer to determine which lines were supposed
            to be in the indented block. I pointed out that if someone
            accidentally moves a curly brace, the same problem can occur.
            >
            I like significant whitespace, but a forum, newsgroup manager (like
            Google Groups in the beginning), email management program, blog comment
            system, etc, may strip leading whitespace, and it usually doesn't
            "move" braces. A language (like Python) doesn't exist alone in vacuum,
            it exists in an ecosystem of many other programs/systems, and if they
            don't manage leading whitespace well, such language may have some
            problems :-)
            >
            Bye,
            bearophile
            Certainly, you are correct. Most of the time, I zip up any source code
            for email purposes. But newsgroup managers are certainly an issue.
            For comment thingies online, the preformat tag is your friend, too.

            It is annoying that certain communication channels do not respect
            white-space. I dislike using braces because I have to indicate my
            intentions twice: once for the compiler and once for humans.

            In the situations where I use Python, though, I haven't had a problem.
            In the situations where my coworker is using Python (code updates
            through CVS), he also shouldn't have a problem.

            Comment

            • Ben Finney

              #7
              Re: do people really complain about significant whitespace?

              "infidel" <saint.infidel@ gmail.comwrites :
              It just sounds like so much trivial nitpickery that it's hard to
              believe it's as common as we've come to believe.
              As others have pointed out, these people really do exist, and they
              each believe their preconception -- that significant whitespace is
              intrinsically wrong -- is valid, and automatically makes Python a
              lesser language.

              One of the most stupid language-definition decisions that most people
              have come across is the Makefile format. If you're not familiar with
              it, spaces and tabs are *each* significant. Specifically, putting
              spaces where a tab is required will result in a file that, while it
              may be visually identical to a correctly formatted file, doesn't parse
              correctly. In hindsight it's trivial to predict the needlessly painful
              learning process that ensues.

              This is a very painful memory for many programmers, and the general
              opinion that results is "syntactica lly significant whitespace is
              bad". This is the phrase that always gets brought out, and it's often
              clear that the person hasn't considered *why* it's bad.

              The issue with the Makefile format (lampooned wonderfully by the
              Whitespace programming language) is that *invisible* differences in
              whitespace should not be significant. In a Makefile, you *must* mix
              spaces and tabs in the same file; this leaves the door wide open to
              invisible differences. In Python, an admonishment of "always indent
              each file consistently" suffices.

              Hope that goes some way to explaining one possible reason why rational
              people can consistently react in horror to the issue.

              --
              \ "Friendship is born at that moment when one person says to |
              `\ another, 'What! You too? I thought I was the only one!'" -- |
              _o__) C.S. Lewis |
              Ben Finney

              Comment

              • bearophileHUGS@lycos.com

                #8
                Re: do people really complain about significant whitespace?

                Jason wrote:
                But newsgroup managers are certainly an issue.
                For comment thingies online, the preformat tag is your friend, too.
                Time ago I used to add a | or something similar at the beginning of
                lines, to avoid the leading whitespace stripping done by Google Groups.
                Other (silly) solutions are to add explicitely the number of indents at
                the beginning of a line (2 digits suffice), or to even add explicit
                #end comments just under the dedents, so a script can read such ending
                comments and reconstruct the original Python indentations... (lines
                splitted with \ and similar require some extra care).

                Bye,
                bearophile

                Comment

                • Jim

                  #9
                  Re: do people really complain about significant whitespace?

                  He points out that if some code gets accidentally dedented, it is
                  difficult for another programmer to determine which lines were supposed
                  to be in the indented block. I pointed out that if someone
                  accidentally moves a curly brace, the same problem can occur.
                  Anecdotally, I've never had either problem.
                  >
                  I have many times found that in moving a multi-screen block of code
                  from one place to another (where the indent is less or more) then I
                  have trouble re-indenting the code. That is not to say that I don't in
                  the end prefer the significant whitespace, but I have had errors moving
                  code like:
                  if ..
                  try:
                  ..
                  except
                  ..
                  else ..
                  where it wound up (with the help of the emacs tab key) as
                  if ..
                  try:
                  ..
                  except
                  ..
                  else ..
                  .. I attempt to be careful, but certainly it has happened to me.

                  Jim

                  Comment

                  • Michiel Sikma

                    #10
                    Re: do people really complain about significant whitespace?


                    Op 8-aug-2006, om 1:49 heeft Ben Finney het volgende geschreven:
                    As others have pointed out, these people really do exist, and they
                    each believe their preconception -- that significant whitespace is
                    intrinsically wrong -- is valid, and automatically makes Python a
                    lesser language.
                    Well, I most certainly disagree with that, of course, but you gotta
                    admit that there's something really charming about running an auto-
                    formatting script on a large piece of C code, turning it from an
                    unreadable mess into a beautifully indented and organized document. I
                    actually sometimes intentionally programmed ugly code so that I could
                    do that. I kind of miss it. :)

                    Michiel

                    Comment

                    • Bruno Desthuilliers

                      #11
                      Re: do people really complain about significant whitespace?

                      infidel wrote:
                      Where are they-who-hate-us-for-our-whitespace?
                      You may find some on comp.lang.ruby. ..

                      Comment

                      • gslindstrom@gmail.com

                        #12
                        Re: do people really complain about significant whitespace?

                        infidel wrote:
                        Where are they-who-hate-us-for-our-whitespace? Are "they" really that
                        stupid/petty? Are "they" really out there at all? "They" almost sound
                        like a mythical caste of tasteless heathens that "we" have invented.
                        It just sounds like so much trivial nitpickery that it's hard to
                        believe it's as common as we've come to believe.
                        Some of it may be a reaction from "old-timers" who remember FORTRAN,
                        where (if memory serves), code had to start in column 16 and code
                        continutations had to be an asterik in column 72 (it's been many years
                        since I've done any work in FORTRAN, but you get the idea)

                        Or it may be a reaction from Assembler, which is also quite
                        column-centric (is Assembler still taught in schools??).

                        But most likely, it's different. It's easier to complain about things
                        than to actually check them out. Recently I had a friend tell me that
                        they absolutely hated a certain tv personality/author. When I asked if
                        they had ever watched the person or read one of their books, they said
                        "Why should I? I hate them!!". I think the same attitude comes into
                        play with computer languages.

                        One more thing. I have many friends that love to program Perl.
                        Without bashing the language, I find it ironic when they say "There's
                        more than one way to do it" but inisit that I should be using Perl
                        while they quote Python as "There's only one way to do it" though
                        (most) Python coders I know are fairly comforatble dealing with
                        multiple languages.

                        --greg

                        Comment

                        • infidel

                          #13
                          Re: do people really complain about significant whitespace?

                          One of the most stupid language-definition decisions that most people
                          have come across is the Makefile format.
                          <snippage/>
                          Hope that goes some way to explaining one possible reason why rational
                          people can consistently react in horror to the issue.
                          Ah, thanks for that. This peek into history makes the irrational fear
                          of significant whitespace seem a little less irrational.

                          Comment

                          • infidel

                            #14
                            Re: do people really complain about significant whitespace?

                            All societies demonise outsiders to some extent. It's an unfortunate
                            human (and animal) trait.
                            Which is why I questioned it.
                            So just block your ears when the propaganda vans with the loud-speakers
                            on top drive past your dwelling :-)
                            Funny how using python makes me feel like a member of some kind of
                            rebellion against the empire. Where I work it's all VB, VB.NET, and
                            ASP.NET. I've been the lone voice in the wilderness for so long that
                            I've become an inside joke. I actually have a certificate that says
                            "Most likely to re-write the system in Python".

                            *sigh*

                            Comment

                            • Thomas Guettler

                              #15
                              Re: do people really complain about significant whitespace?

                              Am Mon, 07 Aug 2006 14:43:04 -0700 schrieb infidel:
                              Where are they-who-hate-us-for-our-whitespace? Are "they" really that
                              stupid/petty? Are "they" really out there at all? "They" almost sound
                              like a mythical caste of tasteless heathens that "we" have invented.
                              It just sounds like so much trivial nitpickery that it's hard to
                              believe it's as common as we've come to believe.
                              I like python, but sometimes i don't like that python allows
                              spaces and tabs. It would be easier if you had less choice and
                              must use four spaces.

                              That's one small argument against the current whitespace syntax in python.

                              Thomas



                              Comment

                              Working...