Legacy Code Definition & Meaning

Legacy code refers to source code that has been inherited from a previous version of a website or software application. Developers often regard legacy code with some disdain because it is thought of as less reliable than state-of-the-art new code. This comes from an assumption that the previous developer who wrote the code was less skilled or could have done a better job, but the reality is that legacy code is usually reflective of the constraints and parameters in place when it was written. Therefore, legacy code should not be expected to work seamlessly with all future updates. This also means all new code will become legacy code at some point.

How to use legacy code

While not all legacy code is inherently bad, there are steps programmers should take to review and revise legacy code so it can maintain its integrity.

  • Read the documentation. Keep on hand the documentation that accompanies the legacy code. This will help you make sense of all the moving parts so you can understand what impact one piece of code has on the broader system.
  • Run legacy tests. Create and perform tests on the legacy code so you can identify all of the problem areas. This includes unit tests and characterization tests.
  • Try refactoring. Refactoring involves simplifying the internal code structure to prevent software entropy. This eliminates potential weaknesses and minimizes the amount of changes needed, but it should be done in small doses to avoid any major disruption.
  • Make changes incrementally. Similar to the process of refactoring, any changes to the function of the code should be documented and implemented gradually so that each modification can be tested and reviewed individually. Otherwise, you could end up with a broken system and no idea what’s causing the malfunction.

Related links:

Avatar
Kaiti Norton
Kaiti Norton is a Nashville-based Content Writer for TechnologyAdvice, a full-service B2B media company. She is passionate about helping brands build genuine connections with their customers through relatable, research-based content. When she's not writing about technology, she's sharing her musings about fashion, cats, books, and skincare on her blog.

Top Articles

The Complete List of Text Abbreviations & Acronyms

From A3 to ZZZ we list 1,559 text message and online chat abbreviations to help you translate and understand today's texting lingo. Includes Top...

How to Create a Website Shortcut on Your Desktop

This Webopedia guide will show you how to create a desktop shortcut to a website using Firefox, Chrome or Internet Explorer (IE). Creating a desktop...

Windows Operating System History & Versions

The Windows operating system (Windows OS) refers to a family of operating systems developed by Microsoft Corporation. We look at the history of Windows...

Hotmail [Outlook] Email Accounts

By Vangie Beal Hotmail was one of the first public webmail services that could be accessed from any web browser. Since 2011, Hotmail, in terms...

IT Observability Definition &...

IT observability is the theory that a system's internal state should be understood...

Data Corruption Definition &...

Data corruption is the process of data becoming unreadable or invalid. It typically...

Subschema Definition & Meaning

A subschema is a database view that filters or organizes all data to...