> The list comprehension is ever slightly more readable.
I disagree - it's terse to the point of being hard to parse, particularly when you get smart ones like:
[x for x in t if x not in s]
> It is a bit faster to write the code for the Python variant.
Code should be written to be read. Saving a few keystrokes vs time spent figuring out the `not in in not with` dance gives the the edge to Golang here. It's "high context"
> - Performance in number crunching
> - Performance in concurrency
And "performance in all other areas". See the thread last week about massive speedups in function calls in python where it was still 5-10x slower than go.
> So where does the perceived legitimacy of these critiques come from? I don't know.
It's pretty hard to discuss it when you've declared that performance isn't a problem and that type annotations solve the scalability of development problem.
I still believe Python comprehensions have confusing structure and in real code I've seen it's 10x worse with 5+ expressions packed in a single line. I much prefer a Nim's style of list comprehensions:
let a = collect:
for word in wordList:
if word notin bannedWords:
word
let b = collect(for x in list: x)
It's still very terse, but, more importanly, it's the same syntax as a regular `for loop`. It has the structure, where in Python complex comprehensions look like a "keyword soup".
I disagree - it's terse to the point of being hard to parse, particularly when you get smart ones like:
> It is a bit faster to write the code for the Python variant.Code should be written to be read. Saving a few keystrokes vs time spent figuring out the `not in in not with` dance gives the the edge to Golang here. It's "high context"
> - Performance in number crunching > - Performance in concurrency
And "performance in all other areas". See the thread last week about massive speedups in function calls in python where it was still 5-10x slower than go.
> So where does the perceived legitimacy of these critiques come from? I don't know.
It's pretty hard to discuss it when you've declared that performance isn't a problem and that type annotations solve the scalability of development problem.