“Legacy” Skills
![](https://www.vwds.pt/wp-content/uploads/2024/06/code-5113374_1280-1200x400.webp)
During onboarding, you may find that your new team is responsible for handling critical legacy code. But what exactly is legacy code? As the name suggests, it refers to outdated software that is difficult to replace due to its wide use and high value for the business. It also poses considerable risks regarding security vulnerabilities, regulatory compliance, and long-term maintenance costs. It represents a challenge due to factors such as rapid technological advancements, budget constraints, and evolving business requirements.
The way developers are introduced to the code will give an idea of the quality of the legacy code. If the code is introduced as “Don’t worry about this code. It will be replaced soon,” then chances are it’s bad legacy code. However, if the code is introduced as “We need to respect this code because it is an important part of our business,” then it’s good legacy code.
The good legacy code may be implemented with outdated libraries or languages that are no longer supported, or it may use old pattern codes. Despite these shortcomings, good legacy code is characterized by having thorough tests, necessary documentation, and a good architecture that allows developers to refactor without creating a significant impact on the business.
Bad legacy code, on the other hand, brings the shortcomings that exist in good legacy code without redeeming qualities, and presents huge technical debt that increases every time a bad developer works on it.
Consider encountering two different legacy codebases: One has clear documentation, comprehensive test coverage, and a well-designed architecture, but it uses outdated technology. The other has poor documentation, spaghetti code, and quick fixes, making even the most superficial changes difficult.
The result is similar for both scenarios. The complexity of either evolving or maintaining the code proves to be a difficult task, requiring significant time and human resources. As a result, new features take longer to develop, requiring additional work from developers. The most challenging part, however, is to justify this to the stakeholders.
Developers often try to avoid working with legacy systems due to the challenges they pose. Old technology, technical debt, and lack of documentation and testing can make every release a roller coaster ride. Moreover, dealing with the stakeholders’ expectations is not easy.
When a developer receives the requirements for a new feature, they start working on it. However, they may encounter problems, leading to delays and difficulty explaining them to the stakeholders. As time passes, errors may arise, leading to conflicts and a toxic environment that can affect the relationship between the team and stakeholders. Stakeholders’ trust in the team slowly decreases, and the team feels like they are not being understood.
Throughout our journey, we are often advised to enhance our technical knowledge. We need to constantly learn new libraries, languages, paradigms, and tools every day. However, in dealing with legacy scenarios, we are not necessarily dealing with something new, but rather with something old. This is where soft skills come into play. Effective communication, collaboration, adaptability, problem-solving abilities, a positive attitude, and empathy are all crucial skills that we need to possess to work with legacy code.
Effective communication involves two key elements: active listening and clear, non-violent communication. Active listening enables developers to understand the requirements and priorities of the stakeholders, allowing them to balance their efforts and avoid wasting time on features with less impact.
On the other hand, clear and non-violent communication allows developers to convey their needs, even when delivering difficult messages such as requesting more time to work on code.
Effective collaboration between developers and stakeholders is crucial. This enables the developer to gain a better understanding of the project and previous decisions and find a middle ground. For instance, the developer may propose a compromise where the stakeholders’ objectives can be achieved, while the team may work on improving the codebase by doing some refactoring.
Legacy code that uses outdated or unsupported technology poses challenges and increases the complexity of maintenance and evolution. Developers should try to find adaptable solutions for obstacles, instead of proposing to rebuild everything from scratch, which should be considered a last resort. Possessing problem-solving skills and being creative can significantly extend the lifetime of the legacy code.
Handling old code can be challenging, which may involve successes and setbacks. You may come across legacy code carrying significant technical debt, and it’s crucial to maintain a positive attitude towards adopting best practices. Enforcing best practices such as unit testing, clean code, and documentation is essential. By treating the code with respect and aiming to improve it every time we make changes, we can enhance its longevity, even if we are the first ones to work on it.
Understanding legacy code requires respecting the decisions made by its creators. As developers, we all do our best work with the available resources and time. Developing empathy for the legacy of others is the first step towards effectively reading and comprehending the code they wrote. This understanding allows us to understand the reasoning behind each solution, which is essential for effective problem-solving.
Soft skills are crucial when working with any code, especially with important code like legacy code that can significantly impact the business. It can also help build a positive relationship between the development team and the stakeholders. While we focus on improving our technical skills, we should also dedicate time and effort to improving our soft skills. By combining technical expertise with solid soft skills, developers can foster collaboration, facilitate knowledge sharing, and drive meaningful improvements in legacy systems.
Take a moment to reflect on your own experiences with legacy code. How have soft skills such as effective communication and problem-solving influenced your approach to dealing with legacy systems? Consider leveraging these skills to overcome challenges and drive positive change in your projects.