Message173778
> >- x = x * 2 - 1
> >- hypot2 = x * x + y * y
>
> Why you remove this?
As I explained in my previous message, even if valid, these are IMHO less clear than x*2 - 1 and x*x + y*y.
> >- c = (a+b) * (a-b)
> >+ c = a+b * a-b
>
> This changes the semantic.
It does indeed, but I think it's worth pointing out that misleading spacing should be avoided. Maybe a different example could be used.
> >but otoh 'x*2 - 1' is a better alternative.
>
> Can you justify this?
x*2 - 1 gives a visual hint of what gets executed first,
x * 2-1 gives a wrong/misleading hint of what gets executed first,
x * 2 - 1 gives no hint at all.
I think that providing the correct hint is better than not providing any hints (and clearly better than providing the wrong hint!). |
|
Date |
User |
Action |
Args |
2012-10-25 17:50:21 | ezio.melotti | set | recipients:
+ ezio.melotti, rhettinger, docs@python, serhiy.storchaka, pwuertz |
2012-10-25 17:50:21 | ezio.melotti | set | messageid: <1351187421.67.0.142747290225.issue16239@psf.upfronthosting.co.za> |
2012-10-25 17:50:21 | ezio.melotti | link | issue16239 messages |
2012-10-25 17:50:21 | ezio.melotti | create | |
|