Clean Code for Teams0:00
Writing good code is not only about improving your own experience when working on a new feature or bug fix. It has a profound impact on the performance of the whole team. The same functionality can take either weeks or days to implement, depending on how your code is structured. When you're working on implementing a new module from scratch, always keep the context of your project in mind and take the time to set up the code in a way that will make it easy for you to maintain and extend it. Separate the responsibilities, abstract the dependencies, and test your code to make sure it works regardless of the concrete implementations. The time you'll need to set the proper code design and write the tests should always be part of the original estimation. It's not something that your manager should approve. It's not an extra work. This is an indivisible step of the work that you're asked to do. If you want to write code that's easy to extend and maintain.
Improving Legacy Code0:50
This is an indivisible step of the work that you're asked to do. If you want to write code that's easy to extend and maintain. If your code is a coupled mess, it's difficult to keep your new code clean and follow the best practices. Even if you don't have the time to refactor the original code, there are techniques you can use to improve the codebase. One step at a time. When you're pressured by deadlines, use the sprout and rev techniques to quickly reference the new, clean code in your legacy codebase. When you can dedicate time, invest into some refactoring using seams. And always keep a safety net with characterization tests. Just as an additional motivation, 1% improvement each sprint means 30% improvement over the course of the year. Don't waste that potential.
Continuous Improvement Mindset1:30
Just as an additional motivation, 1% improvement each sprint means 30% improvement over the course of the year. Don't waste that potential. Remember, clean code is not a stake you reach. It's a mindset that's taking you on this journey of continuously producing code that's easy to manage. Enjoy that journey.
