Re:Python 3.8.0a1 is now available for testing
by legostormtroopr on Monday February 04, 2019 @04:56PM
(#19081020)
I can't take a programming talk seriously if it declares in giant font "Less lines are better" (slide 38).
Any C program can be written as a single line, with no linebreaks - that doesn't make it "better" by any metric.
Python is built around its readability, and slide 44:
> group = match.group(1) if (match := re.match(data)) else None
is anything but. 'match' is assigned after its first use, and it took me far to long to mentally parse what it was doing.
Re:Python 3.8.0a1 is now available for testing
by maceurt on Wednesday February 06, 2019 @12:44PM
(#19097550)
C is different than python though. Python already forces readability things like forcing indent and newline. In most scenarios making a python program in as few lines as possble will make the program more readible.
Re:Python 3.8.0a1 is now available for testing
by ssutch3 on Monday February 04, 2019 @12:46PM
(#19078599)
Yes, you can. How do you think your brain learned the original way?
Re:Python 3.8.0a1 is now available for testing
by gonational on Monday February 04, 2019 @01:55PM
(#19079405)
Intuition is defined as being based on what one feels to be true even without conscious reasoning.
Something that is unnatural, such as an operator mixed with an expression is anything but natural, in the context of Python.
I can force myself to recognize the pattern; yes.
Also, the example I linked to in the slide show does feel somewhat intuitive (usage in a while loop).
Re:Python 3.8.0a1 is now available for testing
by a1369209993 on Monday February 04, 2019 @02:20PM
(#19079692)
> 1. https://speakerdeck.com/di_codes/pep-572-the-walrus-operator...
Direct link: https://speakerd.s3.amazonaws.com/presentations/025e2c4bf551... (s/preview_// for a larger version)
It's very exciting to remove these sorts of redundant lines, but I cannot train my brain to intuitively view that line as it will be interpreted.
There is one case where the benefit, IMHO, far outweighs the negatives, and that can be seen in slides 30-31 of Dustin Ingram's slideshow[1].
PEP 572... the day Python jumped the walrus.
1. https://speakerdeck.com/di_codes/pep-572-the-walrus-operator...