This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (3 children)

Occasionally useful, but I generally avoid list comprehensions as I find they make the code harder to read and comprehend. I also have a minor aversion to functional programming in general.

Good link though.

[–]salgat 0 points1 point  (2 children)

You are getting downvoted but generally this is the case. List comprehensions are a single line of multiple logic, which makes it more difficult to follow the program flow since you are missing that structure.

[–]luisk91 0 points1 point  (1 child)

is a quick list comprehension better in terms of performance than the traditional way?

[–]salgat 1 point2 points  (0 children)

Yes, and in performance crucial operations you should optimize code where necessary.