Playing: 059: Hasty Treat - Refactoring
Potluck - $100/hr × Redux Replacements × Full Stack Designers × JWT × VS Code Tips × More
Potluck - Editor Fonts × Portfolios × Meetup Tips × Switching to Windows × Freelancing Sources
Potluck EP × Remote Work × Headless WordPress × Good Client Questions × Alternate Careers × React API Credentials
Potluck EP × Is Redux Dead × Learning Quickly × Developing Solo × Specialist vs Generalist × Funnest Projects × Wes’ BBQ Course
Potluck EP × Vue.js × Headless WP × Typescript & Flow × Productivity × Server Side Rendering × Yeoman
Wes and Scott's Lives - Breakdancing, BBQ, Wives, Work/Life Balance, Problem Solving, YouTube Subscriptions
Snack Pack — CSS Frameworks, React HOC, Render Props, Coding Designers, Early Career Advice and a sound board!
Hosting & Servers — Heroku, Now, Galaxy, Digital Ocean, Linode, Docker, Netlify and more!
Jul 23rd, 2018
Hasty Treat - Refactoring👇 Download Show✏️ Edit Show Notes
In this Hasty Treat, Scott and Wes discuss refactoring, what it is, why you should do it, when to do it, as well as best practices and much more.
Netlify — Sponsor
Netlify is the best way to deploy and host a front-end website. All the features developers need right out of the box: Global CDN, Continuous Deployment, one click HTTPS and more. Hit up netlify.com/syntax for more info.
5:00 - What is refactoring and why would you do it?
- Re-writing code while maintaining functionality
- The first code you write is most likely not your best code
7:32 - Benefits To Refactoring
- Keep part of your codebase in your head
- Keep codebase timely and up to date (E.g. promises, async, await, etc.)
- Writing code from the vantage point of having already built your product
- Performance improvement
12:54 - When to refactor
- When it's stopping your from progressing
- When bringing someone new on to your team
- When you can see a more elegant solution
- When you're having performance issues
- When you're sharing or presenting code
- When you have a large codebase that needs to be broken up into smaller components
19:03 - Tips on how to refactor
- Testing will make refactoring easier
- Identify bad code and problem areas
- Use git as an escape hatch
- Break things into smaller chunks
- Publish often use code to npm as modules
- Facebook's Codemod