3 ms·
This is one of the reasons I love working on LibreOffice. I think most people acknowledge that LibreOffice is a pretty decent office suite. But it is just over
by chris_wot 11y ago
This is one of the reasons I love working on LibreOffice. I think most people acknowledge that LibreOffice is a pretty decent office suite. But it is just over 30 years old now and it has acreted massive amounts of legacy code, some questionable design decisions and in terms of often trying to track it in version control it can be a nightmare if you go back far enough.
But it would definitely be a mistake to rewrite it from scratch. There are millions of users who rely on it, and it's a massive code base that runs on three major operating systems - four if you include Android.
Instead, the LibreOffice developers are slowly working through refactoring the code base. They are doing this quietly and carefully, bit by bit. Massive changes are being done in a strategic fashion. Here are some things:
* changed the build system from a custom dmake based system to GNU guild - leading to reduced build times and improving development efficiency
* the excising of custom C++ containers and iterates with ones from the C++ Standard Template Library
* changing UI descriptor files from the proprietary .src/.hrc format to Glade .ui files
* proper reference counting for widgets in the VCL module
* an OpenGL backend in the VCL module
* removal of mountains of unneeded code
* cleanup of comments, in particular a real push to translate the huge number of German comments to English
* use of Coverity's static analysis tool to locate thousands and thousands of potential bugs most of which have been resolved
* a huge amount of unit tests to catch regressions quickly
This has allowed LibreOffice to make massive improvements in just about every area. It has also allowed new features like tiled rendering - used for Android and LibreOffice Online, the VCL demo which helps improve VCL performance, filter improvements which has increased Office compatibility and allowed importing older formats, a redesign of dialogue boxes, menus and toolbars which has streamlined the workflow in ways that make sense and are non-disruptive to existing users, and many more improvements which I probably don't know about it has slipped my mind.
But my point is - if LibreOffice had decided to do a rewrite it would have been a failure. It is far better to refactor a code base that is widely used than to rewrite it, for all the reasons the article says.