r/badcode • • Apr 30 '22

python Looks like Python List Comprehension-phobia is a thing. This is a real commit by a teammate.

Post image
1.2k Upvotes

125 comments sorted by

View all comments

Show parent comment

11

u/FiniteSkills May 01 '22

It’s not so much that it’s harder to read, it’s that it is less efficient code. Python’s list comprehension is a major pro and it’s not all that complicated to understand. Like the top comment says, this is just dumbing the code down for people who stand in the way of progress and learning new things.

3

u/EishLekker May 01 '22

It’s not so much that it’s harder to read

But the top comment was, literally, "this makes it so much harder to read". And that was my only focus with my comment.

1

u/FiniteSkills May 06 '22

Fair point, good sir. I’m with you that the less pythonic way is not any more difficult to read. For most, it’s probably easier to read unless they’re familiar with list comprehension already.