Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do you say that the code is Legacy code?

Tags:

legacy

Any useful metrics will be fine

like image 774
Nazgul Avatar asked Sep 23 '08 03:09

Nazgul


People also ask

What is considered legacy code?

Legacy code is old computer source code. It could simply refer to an organization's existing code base which has been written over many years, or it could imply a codebase that is in some respect obsolete or supporting something obsolete.

What is legacy code in testing?

Another commonly used definition of legacy code is code written without proper tests. The first definition (“ugly code”) does not necessarily rule out the second one (“code without tests”). We can say that there are many different cases when code can be called “legacy”.

Why does legacy code exist?

Sometimes legacy code exists for a reason. It may point to a team with a crazy high turnover, making little effort in their documentation. Or a team of more experienced developers who are comfortable with older languages. A company may keep legacy code due to competitive advantages over other businesses.


2 Answers

One of the things that I look for in a code is unit test. This will give the freedom to refactor it. So if the code does not have tests I consider it a legacy code.

like image 122
Nazgul Avatar answered Sep 19 '22 00:09

Nazgul


If the code:

  1. has been replaced by newer code that implements the same or functionality or better
  2. is not being used by current systems
  3. is soon to be replaced by something else altogether
  4. has been archived for historic reasons
  5. when vendors stop supporting it
like image 44
TheObserver Avatar answered Sep 20 '22 00:09

TheObserver