Alex Moldovan
https://alexmoldovan.dev
Founder @ JSHeroes
Product Engineer @ CodeSandbox
https://bit.ly/alex-jsnation
Repo reference: https://github.com/codesandbox/codesandbox-client
Architecture must not stand in your way
Resonable shortcuts can be taken when needed
Exceptions are tolerated (but well documented)
https://alexmoldovan.dev/code-bites/colocation-is-king
👩💻
function whoYouGonnaCall() {
return "GHOSTBUSTERS!";
}
👨🏽💻
👩🏿💻
👩💻
Abstraction
De-duplication
Separation of concerns
Zombie code
Unnecessary abstraction
Change propagation
Will these things change together?
How often do you change the reusable code?
Do you need to understand the reusable code?
👩💻
function whoYouGonnaCall() {
return "GHOSTBUSTERS!";
}
👨🏽💻
👩💻
function whoYouGonnaCall() {
return "GHOSTBUSTERS!";
}
function whoYouGonnaCall() {
return "GHOSTBUSTERS!";
}
⌛ 3 months
⌛ 3 months
Comment branch intensive code
Break algorithm in smaller readable steps
Hoist clear values used in conditional rendering
https://www.typescriptlang.org/tsconfig/#strictNullChecks
Use TypeScript as "strict" as you can
Explicitly type all states for your data
Handle all these possible states
Alex Moldovan
Founder @ JSHeroes
Product Engineer @ CodeSandbox
https://bit.ly/alex-jsnation
https://alexmoldovan.dev