Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31881

Re: A desperate lunge for on-topic-ness

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: A desperate lunge for on-topic-ness
Date 2012-10-22 08:29 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-AD7EA5.08290722102012@news.panix.com> (permalink)
References (6 earlier) <5083c7da$0$29978$c3e8da3$5496439d@news.astraweb.com> <mailman.2588.1350819797.27098.python-list@python.org> <508448c6$0$29978$c3e8da3$5496439d@news.astraweb.com> <mailman.2601.1350850942.27098.python-list@python.org> <5084e819$0$29897$c3e8da3$5496439d@news.astraweb.com>

Show all headers | View raw


In article <5084e819$0$29897$c3e8da3$5496439d@news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:

> On Mon, 22 Oct 2012 07:22:18 +1100, Chris Angelico wrote:
> 
> > On Mon, Oct 22, 2012 at 6:11 AM, Steven D'Aprano
> > <steve+comp.lang.python@pearwood.info> wrote:
> 
> >>> Ahh. I totally didn't see that, I'm way too used to reading past
> >>> typos.
> >>
> >> As a programmer, doesn't that screw up your debugging ability?
> > 
> > Reading-past-typos applies mainly to English, which is a pretty
> > redundant language. In code, it would only apply to variable names; with
> > (effectively) single words/tokens standing alone, the automatic
> > correction doesn't really apply. But yes, sometimes I have stared at a
> > piece of code for a long time without knowing why there's an error on
> > line X. (This is another good reason to require that all variables be
> > declared, incidentally. I might have a variable called "source" but not
> > "souce", so using the other causes an instant compile-time failure on
> > the exact line with the bug.)
> 
> "Another" good reason?
> 
> For languages without static types, what other reasons for declaring 
> variables are there?

Variable declarations serve two purposes.  One is to declare the type 
(which obviously doesn't apply to Python).  The other is to declare the 
beginning of a scope.

On occasion, I will make typos in variable names which a 
scope-introduction declaration would have prevented.  If the cost of 
having to declare every variable would be justified by the rare bug it 
would prevent, is another question.

Pet peeve of the day...

Why do you have to write:

global foo
foo = 4

when

global foo = 4

would have been so much easier?

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: A desperate lunge for on-topic-ness Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-10-19 11:21 +0200
  Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-19 22:14 +0000
    Re: A desperate lunge for on-topic-ness Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-19 20:23 -0400
      Re: A desperate lunge for on-topic-ness Grant Edwards <invalid@invalid.invalid> - 2012-10-20 14:18 +0000
        Re: A desperate lunge for on-topic-ness Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-20 15:10 -0400
        Re: A desperate lunge for on-topic-ness Walter Hurry <walterhurry@lavabit.com> - 2012-10-20 20:02 +0000
        Re: A desperate lunge for on-topic-ness David Robinow <drobinow@gmail.com> - 2012-10-20 16:02 -0400
        Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-21 08:07 +0000
          Re: A desperate lunge for on-topic-ness Chris Angelico <rosuav@gmail.com> - 2012-10-21 20:20 +1100
            Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-21 10:00 +0000
              Re: printing (was: A desperate lunge for on-topic-ness) Tim Chase <python.list@tim.thechases.com> - 2012-10-21 06:03 -0500
              Re: A desperate lunge for on-topic-ness Chris Angelico <rosuav@gmail.com> - 2012-10-21 22:43 +1100
                Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-21 19:11 +0000
                Re: A desperate lunge for on-topic-ness Grant Edwards <invalid@invalid.invalid> - 2012-10-21 19:23 +0000
                Re: A desperate lunge for on-topic-ness Roy Smith <roy@panix.com> - 2012-10-21 16:19 -0400
                Re: A desperate lunge for on-topic-ness Chris Angelico <rosuav@gmail.com> - 2012-10-22 07:38 +1100
                Re: A desperate lunge for on-topic-ness Chris Angelico <rosuav@gmail.com> - 2012-10-22 07:22 +1100
                Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-22 06:30 +0000
                Re: A desperate lunge for on-topic-ness Chris Angelico <rosuav@gmail.com> - 2012-10-22 18:03 +1100
                Re: A desperate lunge for on-topic-ness Roy Smith <roy@panix.com> - 2012-10-22 08:29 -0400
                RE: A desperate lunge for on-topic-ness "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-22 20:48 +0000
                Re: A desperate lunge for on-topic-ness Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-22 16:02 -0600
                Re: A desperate lunge for on-topic-ness Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-22 21:39 -0400
                Re: A desperate lunge for on-topic-ness Joshua Landau <joshua.landau.ws@gmail.com> - 2012-10-23 08:35 +0100
                Re: A desperate lunge for on-topic-ness Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-23 10:50 -0600
                Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-23 22:34 +0000
                Re: A desperate lunge for on-topic-ness Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-23 17:24 -0600
                Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-24 00:04 +0000
          Re: A desperate lunge for on-topic-ness Gene Heskett <gheskett@wdtv.com> - 2012-10-21 07:08 -0400
          Re: A desperate lunge for on-topic-ness Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-21 12:42 -0400
        Re: A desperate lunge for on-topic-ness DJC <djc@news.invalid> - 2012-10-21 15:06 +0100
    Re: A desperate lunge for on-topic-ness Tim Chase <python.list@tim.thechases.com> - 2012-10-19 22:27 -0500
      Re: A desperate lunge for on-topic-ness rusi <rustompmody@gmail.com> - 2012-10-20 00:35 -0700
    Re: A desperate lunge for on-topic-ness Roy Smith <roy@panix.com> - 2012-10-20 16:37 -0400
      Re: A desperate lunge for on-topic-ness Walter Hurry <walterhurry@lavabit.com> - 2012-10-21 21:58 +0000

csiph-web