Originally legacy code meant code 'inherited' from authors or from a previous program/system version. Since Michael Feathers published his "Working Effectively with Legacy Code" book, new definition came to be, where code without tests is legacy code.
Questions tagged [legacy-code]
480 questions
9
votes
6 answers
How best to integrate several systems?
Ok where I work we have a fairly substantial number of systems written over the last couple of decades that we maintain.
The systems are diverse in that multiple operating systems (Linux, Solaris, Windows), Multiple Databases (Several Versions of…

Erratic
- 459
- 1
- 5
- 12
9
votes
2 answers
How to use the Symfony 2 Container in a legacy app
Would like to integrate a legacy application with a Symfony 2 application - replacing more and more parts of the old application with Symfony components. The approach I would take is using the Symfony 2 container in the legacy application getting…

chiborg
- 26,978
- 14
- 97
- 115
8
votes
11 answers
What inherited code has impressed or inspired you?
I've heard a ton of complaining over the years about inherited projects that us developers have to work with. The WTF site has tons of examples of code that make me actually mutter under my breath "WTF?"
But have any of you actually been presented…

rball
- 6,925
- 7
- 49
- 77
8
votes
16 answers
Getting your head around other people's code
I'm occasionally unfortunate enough to have to make alterations to very old, poorly not documented and poorly not designed code.
It often takes a long time to make a simple change because there is not much structure to the existing code and I really…

Joel
- 11,431
- 17
- 62
- 72
8
votes
2 answers
How to migrate legacy JS app to modules
I have a large (~15k LoC) JS app (namely a NetSuite app) written in old-style all-global way. App consists of 26 files and dependencies between them are totally unclear.
The goal is to gracefully refactor the app to smaller modules. By gracefully I…

scorpp
- 635
- 10
- 16
8
votes
1 answer
How do I unit test a class with nasty dependencies without a mock framework?
I am working in a legacy C++ codebase and I want to test some methods on a class, DependsOnUgly, that has a dependency which is not easily broken on a big class (Ugly) with lots of external dependencies on the filesystem, etc. I want to get at…

Keith Pinson
- 7,835
- 7
- 61
- 104
8
votes
5 answers
Where is it better to put the initialization code, before the loop or inside it?
Sorry if this is a silly question :-)
Background
I have legacy code that looks like this:
struct {
int field1;
int field2;
int field3;
int field4;
... many many fields
} myStruct;
while (something) {
initialzationFunction(&myStruct);
//…

Jacob G
- 306
- 2
- 8
8
votes
3 answers
CQRS with Legacy Systems
I'm looking to convert a relatively new web-based application with a clear domain model over to more of a CQRS style system. My new application is essentially an enhanced replacement of an older existing system.
The existing systems in my…

reallyJim
- 1,336
- 2
- 16
- 32
8
votes
10 answers
How to start modification with big projects
I have to do enhancements to an existing C++ project with above 100k lines of code.
My question is How and where to start with such projects ?
The problem increases further if the code is not well documented.
Are there any automated tools for…

sud03r
- 19,109
- 16
- 77
- 96
7
votes
1 answer
How do you refactor static classes to use dependency injection?
I've inherited some code that has a class AuthenticationManager with all static methods.
Im introducing DI and wanted to add a constructor that took a dependency UserController
UserController _userController;
public…

Steve Ward
- 1,207
- 3
- 16
- 42
7
votes
0 answers
visual studio find and replace all references
Using Visual Studio (2010) is there any way to combine Find All References with a Replace All capability.
I have inherited VB.NET code written by a VB6 programmer and I want to remove all the references to IIF and many other VB6 functions as they…

Seph
- 8,472
- 10
- 63
- 94
7
votes
3 answers
What are the main syntax changes in Ruby 1.9?
Also, I'm wondering what effect upgrading to Ruby 1.9 would have on legacy code from version 1.86. Is the new version backwards compatible?

Kenneth Johns
- 395
- 1
- 4
- 10
7
votes
7 answers
What ancient, old school code do you still have kicking around?
Having been bored out of my brains the last few days off work sick, I decided to try and dig up some old code. I could find some binary versions of some ancient Atari ST stuff I wrote, but I couldn't find any source. I did manage to dredge up an old…

Steven Robbins
- 26,441
- 7
- 76
- 90
7
votes
8 answers
NHibernate on legacy DB
I'm ashamed to say it, but I have to. I have not worked with ORM's. I'm really considering NHibernate as it seems to be the most mature product for .Net out there (please correct me if I'm wrong). Now, the thing is that we have a big…

Patrik Hägne
- 16,751
- 5
- 52
- 60
7
votes
1 answer
Proper Architecture for Application-Level Collections
Given an application-wide collection of objects, and many unrelated classes that need frequent access to these objects, what is the best way to provide said access?
Example:
// Object A, stored in collections, used to do useful things
class A
{
…

John Neuhaus
- 1,784
- 20
- 32