Drive to remove unused code in LibreOffice
Written by Sue Gee   
Thursday, 12 January 2012

Thanks to the efforts of its volunteer taskforce, over half the unused code in LibreOffice has been removed over the past six months. It's good to see this clean-up operation but it does raise questions about the amount of dead code lurking out there in the wild.

Carrying around unwanted and unused code is a real burden - it slows performance and makes code more difficult to maintain.  

 

Michael Meeks, a longtime OpenOffice.org developer who is now one of the seven board members of The Document Foundation, has produced a graph that shows how the number of identified unused methods has dropped from nearly 5200 to around 2000.

 

meekslo

In his accompanying blog post Meeks writes:

It seems that over half of our unused code has now bitten the dust. Unfortunately as we remove more, more wastage tends to be revealed, which explains some of the upward jumps in the graph, nevertheless the trend is clearly down. One of the side benefits of the unsung heroes working at the conversion of our old-style macro driven generics to modern STL is that this loses us several unused methods per class converted.

Meeks points out that an unusedcode.easy file in LibreOffice lists methods that should be removed and suggests that joining this clean-up campaign is a good way to get involved with the LibreOffice project. He also recommends those working on other projects, to use the callcatcher method, developed by Caolan McNamara of RedHat, to identify unused methods lurking in their own code.

It is a worthy but sobering enterprise. To remove dead code is a good thing, but how can we have reached this point and seriously be discussing a situation where dead code is allowed to remain undetected and unremoved for so long?

The scale of the dead code in LibreOffice is shocking, and it probably isn't because the code base is especially bad. Can you imagine this in any other engineering discipline? Oh yes, we built the bridge but there are a few hundred unnecessary iron girders that we forgot to remove... Oh yes, we implemented the new chip but that area over there is just a few thousand transistors we no longer use... and so on.

 

.

blog comments powered by Disqus

 

To be informed about new articles on I Programmer, subscribe to the RSS feed, follow us on Google+, Twitter, Linkedin or Facebook or sign up for our weekly newsletter.

Banner


Fear And Loathing In the App Store 6 - Apple's Reasons For Rejection
03/09/2014

Apple doesn't give much information on how it performs its app evaluation, or even on the results of said evaluations. Mostly all you get is a decision with a rough idea of what the problem is. 

 [ ... ]



Microsoft's WinJS - New Cross-Platform Library
19/09/2014

WinJS was Microsoft's JavaScript framework for the creation of "Metro" or WinRT apps. Recently it was open sourced and now, with the release of version 3.0, it has escaped the confines of WinRT to bec [ ... ]


More News

Last Updated ( Thursday, 12 January 2012 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.