Why this matters
Improves readability and avoids unnecessary allocations/time.
Prefer comprehensions over map/filter chains and avoid double-sorting or sorting inside loops.
Improves readability and avoids unnecessary allocations/time.
Side-by-side examples engineers can pattern-match during review.
result = list(map(f, filter(pred, xs)))
for _ in range(3): xs = sorted(xs)result = [f(x) for x in xs if pred(x)]
xs = sorted(xs) # once, outside loopssorted(sorted(xs))xs = sorted(xs, key=key)From the same buckets as this rule.
All static JS/CSS/font/image files MUST use content-hashed filenames (e.g., app.9c1a7b.js) and be served with "Cache-Control: public, max-age=31536000, immutable". HTML and other non-fingerprinted documents MUST be served with "Cache-Control: no-cache" (or equivalent) to enable conditional revalidation.