Re: Spacing conventions

2017-09-29 Thread Chris Angelico
On Sat, Sep 30, 2017 at 3:46 AM, Steve D'Aprano wrote: > On Fri, 29 Sep 2017 03:01 pm, Chris Angelico wrote: > >> On Fri, Sep 29, 2017 at 2:38 PM, Steve D'Aprano >> wrote: >>> On Thu, 28 Sep 2017 03:56 pm, Bill wrote: >>> I worked in maintenance programming. You got the hand you were dealt!

Re: Spacing conventions

2017-09-29 Thread Steve D'Aprano
On Fri, 29 Sep 2017 03:01 pm, Chris Angelico wrote: > On Fri, Sep 29, 2017 at 2:38 PM, Steve D'Aprano > wrote: >> On Thu, 28 Sep 2017 03:56 pm, Bill wrote: >> >>> I worked in maintenance programming. You got the hand you were dealt! >>> And you weren't allowed to "improve" the code unless the cu

Re: Refactoring (was: Spacing conventions)

2017-09-29 Thread Chris Angelico
On Sat, Sep 30, 2017 at 12:45 AM, Stefan Ram wrote: > Chris Angelico writes: >>If the behaviour remains *exactly* the same, then it's a code >>improvement (aka a refactoring), not a bug fix. > > Usually, one cannot observe whether behavior stays the same, > because a program does not map to b

Re: Spacing conventions

2017-09-28 Thread Bill
Steve D'Aprano wrote: On Thu, 28 Sep 2017 03:56 pm, Bill wrote: I worked in maintenance programming. You got the hand you were dealt! And you weren't allowed to "improve" the code unless the customer contracted you to do so. How do you tell the difference between a bug fix and an code improve

Re: Spacing conventions

2017-09-28 Thread Chris Angelico
On Fri, Sep 29, 2017 at 2:38 PM, Steve D'Aprano wrote: > On Thu, 28 Sep 2017 03:56 pm, Bill wrote: > >> I worked in maintenance programming. You got the hand you were dealt! >> And you weren't allowed to "improve" the code unless the customer >> contracted you to do so. > > How do you tell the di

Re: Spacing conventions

2017-09-28 Thread Steve D'Aprano
On Thu, 28 Sep 2017 03:56 pm, Bill wrote: > I worked in maintenance programming. You got the hand you were dealt! > And you weren't allowed to "improve" the code unless the customer > contracted you to do so. How do you tell the difference between a bug fix and an code improvement, if the behavi

Re: Spacing conventions

2017-09-28 Thread Roel Schroeven
Steve D'Aprano schreef op 28/09/2017 3:45: One of Raymond Hettinger's videos talks about writing beautiful Python code, and how slavishly obeying PEP 8 is not really productive. I'll try to find a link later and post it. That would be Raymond Hettinger - Beyond PEP 8 -- Best practices for beau

Re: Spacing conventions

2017-09-28 Thread Paul Moore
On 28 September 2017 at 06:56, Bill wrote: > Steve D'Aprano wrote: >> >> >> Similarly for break and continue. >> >>> I can still see their >>> use causing potential trouble in (really-long) real-world code. >> >> How so? >> >> Besides, if your code is "really long", you probably should factorise

Re: Spacing conventions

2017-09-27 Thread Bill
Steve D'Aprano wrote: Similarly for break and continue. I can still see their use causing potential trouble in (really-long) real-world code. How so? Besides, if your code is "really long", you probably should factorise it into smaller, meaningful chunks. I worked in maintenance programm

Re: Spacing conventions

2017-09-27 Thread Steve D'Aprano
nlearn them later. The PEP 8 spacing conventions are based on similar English and/or maths conventions. For instance, in English, you should never put a space before the colon. This is wrong : ... any more than you would put a space before a comma , or before the full stop at the end of the se

Re: Spacing conventions

2017-09-27 Thread Bill
Thank you for all of the feedback provided! It was just what I was looking for. : ) I'm going to go back and read some of the links more carefully. Bill -- https://mail.python.org/mailman/listinfo/python-list

Re: Spacing conventions

2017-09-27 Thread Christopher Reimer
On Sep 27, 2017, at 12:50 AM, Bill wrote: > > Ever since I download the MyCharm IDE a few days ago, I've been noticing all > sort of "spacing conventions (from PEP) that are suggested. How do folks > regard these in general? > > For instance, the conventi

Re: Spacing conventions

2017-09-27 Thread Peter Otten
Bill wrote: > Ever since I download the MyCharm IDE a few days ago, I've been noticing > all sort of "spacing conventions (from PEP) that are suggested. How do > folks regard these in general? > > For instance, the conventions suggest that > > if x>y : &

Re: Spacing conventions

2017-09-27 Thread Tim Golden
On 27/09/17 09:50, Bill wrote: If you are teaching beginning students, do you expect them to try to follow these sorts of conventions? Is it perfectly fine to let "taste" guide you (I'm just trying to get a feel for the philosophy here)? I few years ago I wrote a few short blog posts about

Re: Spacing conventions

2017-09-27 Thread Chris Angelico
On Wed, Sep 27, 2017 at 6:10 PM, Thomas Jollans wrote: > Personally I've found that my preferred tool, the Anaconda plugin for > Sublime Text, sometime gets PEP 8 operator spacing wrong, and complains > operators without spaces even where PEP8 explicitly recommends not using > spaces. Read PEP 8,

Re: Spacing conventions

2017-09-27 Thread Thomas Jollans
On 27/09/17 09:50, Bill wrote: > Ever since I download the MyCharm IDE a few days ago, I've been > noticing all sort of "spacing conventions (from PEP) that are > suggested. How do folks regard these in general? PEP 8 (https://www.python.org/dev/peps/pep-0008), the officiall

Spacing conventions

2017-09-27 Thread Bill
Ever since I download the MyCharm IDE a few days ago, I've been noticing all sort of "spacing conventions (from PEP) that are suggested. How do folks regard these in general? For instance, the conventions suggest that if x>y : pass should be written if x > y: pas