Forgot your password?
typodupeerror
Open Source Programming News

Code Cleanup Culls LibreOffice Cruft 317

Posted by timothy
from the let's-just-call-them-introns dept.
mikejuk writes with an interesting look at what coders can get around to after a few years of creating a free office suite: dealing with many thousands of lines of deprecated code: "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. 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." Well, that last one doesn't sound too surprising at all. Exciting to think that LibreOffice (which has worked well for me over the past several years, including under the OpenOffice.org name) has quite so much room for improvement.
This discussion has been archived. No new comments can be posted.

Code Cleanup Culls LibreOffice Cruft

Comments Filter:
  • Automate it (Score:4, Insightful)

    by wisnoskij (1206448) on Friday January 13, 2012 @11:06PM (#38694720) Homepage

    Sounds like they already put a lot of work into this, but someone should tell them that you can automate things like removing unused code.

  • by Rubinstien (6077) on Friday January 13, 2012 @11:15PM (#38694768)

    ...lots of stuff is left lying about which might not be used any longer on the off chance that it might be adapted to some future purpose. Sounds like genetics.

  • by Kenja (541830) on Friday January 13, 2012 @11:18PM (#38694778)
    so most people wont notice a new build.
  • by RelaxedTension (914174) on Friday January 13, 2012 @11:19PM (#38694786)

    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...

    Those would be perfectly valid if upon discovering your girder was 3 inches too short you could instantly create a copy of it, set the original aside, then alter and test that copy of the girder. Then you might leave a few extras lying around.

  • Bad examples (Score:5, Insightful)

    by intx13 (808988) on Friday January 13, 2012 @11:22PM (#38694806) Homepage

    Bridges often have unused structural elements: walk-ways made unsafe by modern traffic levels, maintenance accesses unused for safety reasons, supports made redundant beyond the factor of safety by bridge improvements, etc. Chips and boards too: FPGAs with 10% utilization, chip designs re-purposed with functional components disabled, subsystems replaced in boards by new designers not confident enough to remove the old design, etc.

    Cruft in software is more often removed because (1) software has a potentially longer lifetime than hardware and (2) it's a lot easier to remove an uncalled function from a program than a girder from a bridge! Software cleanup should be an expected and planned part of a project's life cycle.

  • by Anonymous Coward on Saturday January 14, 2012 @12:05AM (#38694984)

    I've seen chemical plants built with millions of dollars worth of unnecessary piping and valves, because the project timeframe meant that it was cheaper to install extra connections that might never be used and save engineering time than waste time re-engineering it.

    If removing unnecessary items can save thirty thousand dollars (say) at the cost of three days, removing the cruft is only worth it if the delay costs less than ten thousand a day.

  • by Anonymous Coward on Saturday January 14, 2012 @12:17AM (#38695028)

    Except for the fact that the machine I'm on right now is running Win 7/64 and is using 900megs with apps running. Thanks for trolling though.
     
    Remember kiddos, when you have to make up fake numbers to support your point of view you're normally wrong. And an asshat.

  • Re:Bad examples (Score:4, Insightful)

    by kbielefe (606566) <karl...bielefeldt+slashdot@@@gmail...com> on Saturday January 14, 2012 @12:54AM (#38695206)

    It's not crazy. A major board redesign will set a schedule back three months or more, so if you have two options and aren't sure which one will work, it's not uncommon to design for both if you have the room. Maybe you're evaluating two vendors. There are also usually components that are only used during development. Sometimes there's an experimental or premium feature that requires an extra chip, but you don't want to make two boards. Of course, most of the time unused components get left off in mass production, but developer's boards or ones from prototype runs might still have them.

  • by Grishnakh (216268) on Saturday January 14, 2012 @02:32AM (#38695522)

    No, a better analogy is to build a house (full of extra materials as the parent said), and then use a giant replicator machine to mass-produce the house, almost instantly, and create thousands and thousands of new homes using that house as the basis. The wasted material in the one house is bad, but not that bad because it's one house, and it takes extra time and labor to do it more efficiently. But multiplied across thousands of identical copies, that wasted material adds up a lot. Plus, it's inefficient and you could have a better-performing house by doing a better job with the small details (better at energy efficiency for example). The slight increase in energy efficiency with that one house, realized by spending a bunch of extra time and effort removing wasted materials and doing a better job with various small details (like making sure the house wrap is applied extremely well rather being hurried and missing some staples in important places), won't amount to much with just the one house. However, multiplied across many thousands of houses, those energy savings add up to a lot.

    The fact that software is easily and quickly replicated with perfect precision and little or no effort or time really makes it hard to make good analogies for it without resorting to Star Trek-style replicators; it's the only technology we have that's like that. And because it can be and is copied so easily, very different dynamics apply to it than to many other fields of endeavor.

  • by hairyfeet (841228) <bassbeast1968@NOsPAM.gmail.com> on Saturday January 14, 2012 @02:32AM (#38695526) Journal

    And THIS gets modded "informative"? Did someone give the trolls extra mod points this week? Did I miss a memo? Because I'm sitting here with not one but TWO Win 7 X64 machines running, one an AMD EEE netbook with 8Gb, the other my AMD 6 core Thuban desktop, also with 8Gb, and I'm using less than 600Mb with the basic theme on the netbook and just a hair under 980Mb on the desktop and that's with Aero and all the bling cranked. You are probably using an old tool that counts cache as "used" memory but since Windows dumps the cache if ANY program requests the memory that simply isn't useful anymore. BTW your old XP box uses so little RAM because it'll dump to paging even if there is plenty of memory free which is just fricking stupid, the RAM is using the same voltage regardless so why not use it to speed things up?

    But if you are seriously looking at 2gb and aren't trolling you need to have that thing checked, because either you have more bugs than a Bangkok Whore or one of your apps is leaking memory like a sieve.

  • Re:Worked Well? (Score:4, Insightful)

    by dokc (1562391) on Saturday January 14, 2012 @02:47AM (#38695592) Journal

    "WORKSFORME"

    The most unhelpful response to a bug report ever.

    But very helpful response on trolling.

  • Re:Automate it (Score:4, Insightful)

    by rgmoore (133276) <glandauer@charter.net> on Saturday January 14, 2012 @03:00AM (#38695628) Homepage

    I'm pretty sure that they don't want to automate it. One of the first things Libre Office did after they forked from OO.o was to come up with a list of "easy hacks" for people who wanted to get involved but didn't know where to start. That includes stuff like dead code removal and translating comments from German to English. By leaving that stuff marked out but undone, they hope to ease new people into the project. That may not be the most efficient way of doing this kind of thing, but if it helps to recruit new developers it will do a lot more for the project in the long run than just getting rid of the cruft. It's a big difference between a project run by paid coders on a tight budget and one that depends on a variable number of volunteers.

  • by Anonymous Coward on Saturday January 14, 2012 @03:21AM (#38695706)

    "Wooooosh"

  • by viperidaenz (2515578) on Saturday January 14, 2012 @05:14AM (#38696014)
    Exactly. Unused RAM is wasted RAM. If nothing is using my RAM, I hope Windows 7 is using it for cache.
  • by Anonymous Coward on Saturday January 14, 2012 @06:00AM (#38696170)

    I always wonder why OOP advocates think that making structured and modular code is not possible in anything else than OOP languages. Truth is, those concepts appeared long before them, and, in fact, were some of the ideas that drove the birth of languages like C

    If your C programs are not modular and structured you can bet I'm not going to hire you.

  • So in a bright moment of usefullness i actually posted your complaint as an 'enhancement' bug report on libreoffice, probably more useful than posting it on slashdot ;P ref: https://bugs.freedesktop.org/show_bug.cgi?id=44780 [freedesktop.org]
  • by Rockoon (1252108) on Saturday January 14, 2012 @11:25AM (#38697622)

    Many its GUI controls are using very bad confusing abstractions. For example, audio, networking, etc.

    They are necessary abstractions because these subsystem themselves are abstractions.

    If you want confusing audio subsystems, look at the mess in Linux right now.. most Linux installs literally have multiple audio subsystems that can output to each other in very confusing master/slave relationships.

  • by Simon Brooke (45012) <stillyet@googlemail.com> on Saturday January 14, 2012 @04:17PM (#38700034) Homepage Journal

    This is true in Europe too. I'm in Scotland. I live in a small but comfortable house I built for myself on my own land last year. It cost in total more than I earn in one month, but less than I earn in two. I'm a senior geek, I get a good wage - but I'm not a banker or a pop-star.

    What makes housing expensive is partly labour, but it is mainly that planning policy creates a form of artificial scarcity, and partly also that government support for home ownership creates a speculative bubble, further inflating the cost. Housing is not intrinsically expensive.

Whoever dies with the most toys wins.

Working...