-
Notifications
You must be signed in to change notification settings - Fork 12
Refactoring For Mortals
coloradokim edited this page Apr 18, 2018
·
1 revision
Dan Levy Denver React Meetup, April 17, 2018
- Tiny Functions
- Decouple and Extract Logic
- Aim for 1-2 lines
- DRY is Overrated
- Make your code readable by other humans
- Pure Functions
- Avoid
this
- Use descriptive names
- One or two words
- Return early, not often
- Use destructuring!
- Spread for for 2x the win
- Big Function?
- Identify steps (validation, shaping)
- Ask if small functions are right for you
- Suggest pure functions
- Count pathways to prove complexity
- Three-word Variables?
- As if they are in the right place
- Could the context be more clear?