Recently, I have read this interview with Kevlin Henney, an independent consultant and a great developer.
These are some very good insights about ways to find dead code:
These are some very good insights about ways to find dead code:
- Static analyzers are a good start
- Search for files that has never changed since a while. "There are many reasons code may be stable — it’s just right, it’s just dead, it’s just too scary — but unless you investigate you’ll never know."
- Runtime monitoring and Dynamic program analysis may be used to rule out parts of the code which is not dead code, effectively reducing the code under investigation
One very interesting note is that:
"Deleting dead code is not a technical problem; it is a problem of mindset and culture."Furthermore, in this very interesting lecture by Kevlin, he tells the very famous story about Kinght corporation which lost hundreds of millions due some dead code left over. Also, narrates some very interesting stories alike. I highly recommend any developer to watch this lecture.
2 comments:
Very interesting, I have similar case need this enhancement
Glad you found it helpful! I would really like to know how it worked with you .. keep in touch
Post a Comment