Hacker News new | ask | show | jobs
by sgarland 543 days ago
> Now I suffer both the noise of the unabstracted thing, and an extra assignment.

Depends on your goals / constraints. From a performance standpoint, the attribute lookups can often dwarf the overhead of an extra assignment.

1 comments

I'm speaking solely from a developer experience perspective.

We're talking about cases where the expression is only used once, so the assignment is free/can be trivially inlined, and the attribute lookups are also only used once so there is nothing saved by creating a temporary for them.