From: Peng Yu on 26 Jul 2010 18:20 This webpage http://www.python.org/dev/peps/pep-0008/ recommends the following. It looks to me that both styles are fine. Could anybody let me know what the rationale is behind this recommendation? - Use spaces around arithmetic operators: Yes: i = i + 1 submitted += 1 x = x * 2 - 1 hypot2 = x * x + y * y c = (a + b) * (a - b) No: i=i+1 submitted +=1 x = x*2 - 1 hypot2 = x*x + y*y c = (a+b) * (a-b) -- Regards, Peng
From: Thomas Jollans on 26 Jul 2010 19:00 On 07/27/2010 12:20 AM, Peng Yu wrote: > This webpage http://www.python.org/dev/peps/pep-0008/ recommends the > following. It looks to me that both styles are fine. Could anybody let > me know what the rationale is behind this recommendation? Beauty is in the eye of the beholder, even when we call it "coding style". There is no rationale, except if you accept "easier to read", "looks better", or "that's what Guido has been doing for years". > > - Use spaces around arithmetic operators: > > Yes: > > i = i + 1 > submitted += 1 > x = x * 2 - 1 > hypot2 = x * x + y * y > c = (a + b) * (a - b) > > No: > > i=i+1 > submitted +=1 > x = x*2 - 1 > hypot2 = x*x + y*y > c = (a+b) * (a-b) >
From: rantingrick on 26 Jul 2010 19:06 On Jul 26, 5:20 pm, Peng Yu <pengyu...(a)gmail.com> wrote: > This webpagehttp://www.python.org/dev/peps/pep-0008/recommends the > following. It looks to me that both styles are fine. Could anybody let > me know what the rationale is behind this recommendation? The rational is simple. Guido is God and if you don't follow his words then you will be tortured. His favorite means is by forcing you to wear Dutch wooden shoes every day whist programming Ruby! ;-)
From: Martin P. Hellwig on 26 Jul 2010 19:15 On 07/27/10 00:06, rantingrick wrote: > On Jul 26, 5:20 pm, Peng Yu<pengyu...(a)gmail.com> wrote: >> This webpagehttp://www.python.org/dev/peps/pep-0008/recommends the >> following. It looks to me that both styles are fine. Could anybody let >> me know what the rationale is behind this recommendation? > > The rational is simple. Guido is God and if you don't follow his words > then you will be tortured. His favorite means is by forcing you to > wear Dutch wooden shoes every day whist programming Ruby! ;-) Wat is er mis met klompen? -- mph
From: rantingrick on 26 Jul 2010 19:24 > Martin wrote: > > Wat is er mis met klompen? Well specifically their made from wood and wood is a very hard substance. Also i did not go into detail but he makes sure to pick shoes that are three sizes too small. You know a good podiatrist can be tough to come by in these times. It's a pretty severe punishment if you ask me.
|
Next
|
Last
Pages: 1 2 3 Prev: Updating path.py Next: How to capture all the environment variables from shell? |