Write Code That's Easy to Maintain
Maintaining a codebase that's easy to read and understand not only contributes to the developer experience, it also has a direct impact on the performance of the team. During this course, we'll cover techniques for designing your code in such a way that will make it easy to extend and maintain in the long run. Regardless of if you start clean, or you inherit a complex codebase, you can own your code and make solid design decisions.
Progress
Series Info
- Episodes
- 14
- Run Time
- 1h 29m
- Difficulty
- Advanced
- Last Updated
- May 20, 2024
- Version
- Latest
Series Episodes
- Episodes (14)
Introduction
Hello! I'm Katerina. In this introductory episode, I will provide a quick overview of what we'll review in this series.Optimize for Readability and Easy Navigation
When it comes to structuring our code for easy maintenance and extension, SOLID design principles offer an excellent guide. We'll start by creating interfaces for what our program needs, following the Interface Segregation Principle - the I in SOLID.Decouple Your Code
Continuing where we started, there are a few improvements we can make to organize our code better. In this lesson, we'll follow the Single Responsibility Principle to help us improve the code structure so we can easily extend our code without changing the same files over and over again whenever a business need arises.Plan for Future Changes
The purpose of having an interface and different classes that implement it is for us to be able to use the classes interchangeably. Following the Liskov Substitution Principle, we can ensure that we don't break the program while doing so.Invert Dependencies
The fourth SOLID principle we'll explore is the Dependency Inversion Principle. According to this principle, our high level code shouldn't depend on low level code; both should depend upon abstractions.Add, Don't Change
Following the Open/Closed Principle, we'll explore how we can extend the functionality of our app by writing new code instead of modifying existing code.Don't Overdo SOLID
The only best practice is the one that works best for your project. Understand the unique needs of your project and adapt your design choices accordingly.Consider Scratch Refactoring
When working with code that's overly coupled, you need to spend much more time reading existing code than writing new code. In this lesson, we'll explore how to approach understanding a complex codebase more systematically.How to Test Untestable Code
There's something known as the legacy code dilemma. To refactor legacy code, you need tests. But legacy code is not testable. So... what do we do? The answer is characterization testing. Let's talk about it.Extending Code That Wasn't Designed for Extensibility
When your code is a tangled mess, it's difficult to break the pattern. In this short video, we'll discuss what happens when you keep adding bad code to a legacy codebase. In the following episodes, we'll review some solutions.Leverage Seams to Add New Functionality to Existing Code
In this lesson, we'll discuss how to add functionality to a legacy codebase by refactoring the existing code and following good design practices.Add Functionality by Applying the Sprout and Wrap Techniques
In this lesson, we'll explore two techniques, sprout and wrap, for extending legacy code with new functionality when you're pressured by tight deadlines.Leave the Codebase Cleaner Than You Found It
'Leave the codebase cleaner than you found it' is common developer advice, but excluding renaming variables and extracting code snippets into separate methods, it's difficult to know what to do. In this lesson, we'll explore some actionable techniques that you can use right now.Wrap Up
That's a wrap for this series! I hope you enjoyed it and learned something new. If you have any questions, feel free to ask in the comments section below. Thank you for watching!
