Prefer inlining what would otherwise be a single-use temporary local variable.
If inlining isn’t possible due to necessary references or code duplication concerns, add const to the
right place to make sure the temporary local variable isn’t assignable by (E.g. NSString *const foo
instead of NSString *foo).
We avoid reassigning variables because:
It makes code harder to read and modify since dependencies between local variables are hard to visualize.
It encourages mutating local variables after assignment which hides surprising side-effects and changes.
Here is a really tangled-up +new method that is hard to read, understand, or modify:
Instead, split out logic into separate components: