DevOps Zone is brought to you in partnership with:

Robert has been a professional software developer since 2001. He has worked in the education, telematics, and payment network industries. He currently lives and works in Des Moines, IA. Robert has posted 10 posts at DZone. You can read more from them at their website. View Full User Profile

Legacy is a Four-Letter Word

01.16.2014
| 10338 views |
  • submit to reddit

The term “legacy” has mixed meanings in software development and I am personally trying to remove it from my vocabulary. It often has a bad connotation. Many developers use it to describe code that they did not write and do not like. It is often used to describe code that may not have used the best developmental practices. Software developers may also take offense to their code being called legacy.

Youthful software developers tend to dislike legacy code. I was once one of those developers. I thought I could easily rewrite a section, feature, or even a whole program in less time than it would take to make minor changes to it. I finally learned my lesson after many, many, m-a-n-y failures (and one success*).

Now, instead of using the term “legacy”, I try to substitute with “existing”. I don’t shy away from existing code. I embrace the fact that the code has many battle scars. Those scars are years of bugs that have presumably been killed. The intrinsic evolution of features and nuances that make the product what it is today. I no longer have a craving to slash and burn code to simply start with a greenfield.

I prefer working on an existing codebase. I love fixing issues that the client has had for many years. I enjoy incrementally making software better one refactor at a time. It is also a lot quicker to see the software I’m writing get in the hands of end-users and make a real impact.

I would like to tell all of the developers that think they are stuck on a legacy project:

Contrary to the term, things aren’t always greener on a greenfield project.

We should all simply enjoy the code we get to write. I know I love writing every line that I can. If you focus on keeping things clean and concise, your legacy will be appreciated by those who follow.


* I actually did rewrite an entire program in one day. However, I was scared out of my mind when the Vice President of Information Technology actually called me on my brazen promise. I ended up working late into the night. I learned a valuable lesson about having a big mouth. That was also the last time I made any more “bold rewrite” statements.




Published at DZone with permission of its author, Robert Greathouse. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Arthur Gorr replied on Thu, 2014/01/30 - 5:45pm

I don't recall who said it but one definition of legacy code is "code without tests". Was it Michael Feathers?

http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052


By the way, can't recommend this book enough.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.