
Hasty Treat - Refactoring
About this episode
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.
Show Notes 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 brining 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
Links Facebook’s Codemod
Syntax043 - 20 JavaScript Array and Object Methods to make you a better developer
Tweet us your tasty treats! Scott’s Instagram
LevelUpTutorials Instagram
Wes’ Instagram
Wes’ Twitter
Wes’ Facebook
Scott’s Twitter
Make sure to include @SyntaxFM in your tweets
More from Syntax - Tasty Web Development Treats
Scott and Wes get into closing the gap between your taste and your skills, with tips on design inspiration, snappier animations and easing. They also share an entry-level setup for recording video les…
Scott and CJ dig into Exact, Expo’s new Rust-based runtime that takes one codebase to web, iOS, macOS and Linux with no React Native involved, plus Bombadil’s property-based testing for web UIs. They…
Scott and Wes sit down with Michael Arnaldi to dig into Effect v4 and why guardrails matter now that AI agents are writing so much of our code. They discuss going zero dependencies, a 5x smaller bundl…
Scott and Wes sit down with GitHub’s Kyle Daigle to ask what the hell is going on with GitHub: the downtime, the agent traffic spike, and the infrastructure overhaul decoupling storage from compute. P…
Wes, Scott, and CJ are back with two weeks of news: Reddit is forcing everyone to log in, r/opensource bans anything AI, and CSS-Tricks is independent again. Plus Anomaly's Hex dictation app, Mitchell…