4 ms·
Someone pointed out to me recently as you say, the idiomatic python sometimes seems like more of a barrier. It takes more time to parse and grok, for their huma
by pen2l 4y ago
Someone pointed out to me recently as you say, the idiomatic python sometimes seems like more of a barrier. It takes more time to parse and grok, for their human brain, a for loop with a zip having multiple interables vs nested for loops. I've been thinking about this. So take, a list comprehension, supposedly better than a for loop at times. The canted take would be that list comprehensions are said in a way of what a human wants, the for loop is more how to do it, and the former is better ipso facto. And I think I've come to appreciate this difference and preference.
My conclusion is that I rather like the opinionated take of python. It might take a liiiiittle bit of a learning curve, but you do come to appreciate the zen of choices they've arrived at after a few decades of going at it.
- tga_d 4y agoWorth pointing out that list comprehensions aren't just a stylistic preference or syntactic sugar, they're significantly better performance than the equivalent for loops.