Categories
xacdo

Thought on Legacy

You know when I had maintained very old systems. In the comment there were many footprints from the former company, the former of former company, the former of former of former company. Three companies’ comments were mixed there. Merger and acquisition, split, and merger again.You can imagine how those codes were. It was terrible.

The problem was that the system worked anyway. It worked not very well but worked okay. It was very old, very inefficient, painful, but working so we could not throw it away. And its maintainer was me.

At that time I was sick of that. I wanted to renew it all. I planned a schedule to develop from scratch by myself alone and it was calculated that it needed 2 years. Oh no, that was impossible.

I think this kind of problems would be anywhere. I think this is the normal case, not very special case. The legacy system is already made. A lot of money is already put there. No plan to renew. Not a single person is available to develop. But that system should work for now at least. 2-year is too long. What could I do?

Now it was 5 years ago and I have an answer, luckily. This answer comes from the book, “Working Effectively with Legacy Code”. Isolate the dirty part and improve little by little. For now we need the dirty part. Anyway it’s working. So we have to embrace it and keep using it. But how we add some new features on it? If we add clean codes on dirty codes, everything will be dirty. So we should block that dirt spreading to the new clean codes. Then we deploy the new features to the world. Get things done and clean it later.

Isolate, separate, refactor, clean, make test cases, do anything. It is very hard but we have to update on it quickly. This is like replacing wheels of running train. Very dangerous and difficult, but it is possible. Moreover, it becomes a routine job after you have done it several times.

Here is Joel’s article I like. He mentioned that Netscape made a wrong decision to renew all from scratch. It had took 3 years. This long period, unfortunately, allowed its competitors to win. I had to thank my former managers who canceled my 2-year renewal plan. Reference: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/

p.s. I also want to add a LAPACK case. This is a very old linear algebra library written in Fortran and still regularly updated. Last modified version, 3.9.0 was updated on Nov 2019. But you know, Fortran is too old. But it is still working well. So usually we use LAPACK as an executable binary file and call it on C++, Java, or any other languages using a wrapper. Many people have tried to port LAPACK to modern languages and there are several projects, but LAPACK is still widely used because it is working well. I think this is a good exmple of Legacy system. Reference: http://www.netlib.org/lapack/

By xacdo

Kyungwoo Hyun

Leave a Reply

Your email address will not be published.