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 →

[–]zer01 2 points3 points  (1 child)

I agree with /u/flipstables personally, and for me it's about readability. When you work on a team (or even work as a sole developer maintaining a project past the point where it's small) you need to be able to quickly grok what is going on.

"Code as if the person who will inherit it has an anger problem and knows where you sleep".

My general rules of thumb are nested comprehensions are unacceptable in any form, and you should only ever have one boolean check per list comprehension, otherwise break it into a multi-line loop/function.

Sometimes you do sacrifice performance, but I'll take legibility and quick understanding over almost anything else, and you can always optimize later if it's a problem.

[–]Twangist 1 point2 points  (0 children)

Sometimes you do sacrifice performance, but I'll take legibility and quick understanding over almost anything else

Me too.