Difference between revisions of "Refactoring plan"

From Inkscape Wiki
Jump to navigation Jump to search
(New page: With Inkscape 0.46 wrapping up, it's time to look forward to our next release, 0.47, and our plans for its development. When we started Inkscape, we began with a codebase with lots of pot...)
 
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
With Inkscape 0.46 wrapping up, it's time to look forward to our next
{{DevDiscussion}}
release, 0.47, and our plans for its development.
 
<div style="width:75em">
== Overview ==


When we started Inkscape, we began with a codebase with lots of
When we started Inkscape, we began with a codebase with lots of
Line 6: Line 8:
resolved.  Inkscape has grown rapidly, especially thanks to Google's
resolved.  Inkscape has grown rapidly, especially thanks to Google's
Summer of Code program.  Unfortunately, while we've gained a lot of new
Summer of Code program.  Unfortunately, while we've gained a lot of new
features, it hasn't addressed the underlying issues - and in some cases
features, it hasn't addressed the underlying issues—and in some cases
has exposed new problems.
has exposed new problems.


Line 13: Line 15:
accidental code duplication, unfinished code, obsoleted code, etc.
accidental code duplication, unfinished code, obsoleted code, etc.


What will the codebase cleanup work entail?  The work will range from
What does codebase cleanup work entail?  The work ranges from
straightforward "grunt" work like making some simple code changes to all
straightforward “grunt” work like making some simple code changes to all
files in the codebase, to meatier work like abstracting widely used code
files in the codebase, to meatier work like abstracting widely used code
into a more concise and powerful algorithm, to advanced work such as
into a more concise and powerful algorithm, to advanced work such as
extracting distinct code into independent code packages.
extracting distinct code into independent code packages.


To boil this down into five high level objectives:
== Objectives and Principles ==


  0.  Complete some of the big architectural refactoring efforts
=== Objectives ===
  1.  Reduce source code line count
  2.  Break useful code out into stand-alone libraries
  3.  Increase code stylistic consistency
  4.  Make the codebase more convenient to code in


, architectural reworkings can often risk incur massive breakages
To boil this down into five high level objectives:
since fundamental pieces of the code are being changed.  In order to
minimize this, I'd like to suggest the following principles:


  * Always keep the tree buildable
#  Complete some of the big architectural refactoring efforts
  * Do major refactorings in small steps
#  Reduce source code line count
  * Hold code review parties with 2-3 others to brainstorm
#  Break useful code out into stand-alone libraries
  * Drop copied-in codebases in favor of external dependencies
#  Increase code stylistic consistency
  * Make sure every function you touch has some doxygen comments
Make the codebase more convenient to code in


Further, this kind of work can go on indefinitely without a clear
=== Principles ===
stopping point, so I think for this release we should use a schedule
with a date-based stopping point.  This will help everyone know how they
should time their work.


  Mar 10  Release 0.46.  0.47 Refactoring / Cleanup work begins
Now, architectural reworkings can often risk incur massive breakages
  Apr
since fundamental pieces of the code are being changedIn order to
  May
minimize this, we would like to suggest the following principles:
  Jun
  Jul 1  Completion of refactoringFocus on Bug Fixing begins.
          Open 0.48 development tree early, for GSoC work.
  Aug    Put out 0.47-pre releases.
  Sep    Release 0.47.
 
For reference, here are some key GSoC dates:
 
  May 26  GSoC work begins.
  Jul 14  GSoC midterm.  First delivery of GSoC code
  Aug 18  GSoC work ends.


This schedule permits us to focus exclusively on refactoring for several
#  Always keep the tree buildable
months, with a due date of July 1st to complete it. It uses a very
# Always keep unit tests passing (and add new unit tests)
early branch point, where we'll split into a stable branch for doing bug
#  Do major refactorings in small steps
fix and release work, and a development branch for the GSoC students to
#  Hold code review parties with 2–3 others to brainstorm
use and for folks to continue right on with refactoring projects if they
#  Drop copied-in codebases in favor of external dependencies
wish.
#  Make sure every function you touch has some doxygen comments
</div>

Latest revision as of 08:26, 10 February 2018


Overview

When we started Inkscape, we began with a codebase with lots of potential but with some architectural limitations that we've never quite resolved. Inkscape has grown rapidly, especially thanks to Google's Summer of Code program. Unfortunately, while we've gained a lot of new features, it hasn't addressed the underlying issues—and in some cases has exposed new problems.

Inkscape's also been extremely successful at gaining a lot of contributors, yet this comes with a price: Stylistic differences, accidental code duplication, unfinished code, obsoleted code, etc.

What does codebase cleanup work entail? The work ranges from straightforward “grunt” work like making some simple code changes to all files in the codebase, to meatier work like abstracting widely used code into a more concise and powerful algorithm, to advanced work such as extracting distinct code into independent code packages.

Objectives and Principles

Objectives

To boil this down into five high level objectives:

  1. Complete some of the big architectural refactoring efforts
  2. Reduce source code line count
  3. Break useful code out into stand-alone libraries
  4. Increase code stylistic consistency
  5. Make the codebase more convenient to code in

Principles

Now, architectural reworkings can often risk incur massive breakages since fundamental pieces of the code are being changed. In order to minimize this, we would like to suggest the following principles:

  1. Always keep the tree buildable
  2. Always keep unit tests passing (and add new unit tests)
  3. Do major refactorings in small steps
  4. Hold code review parties with 2–3 others to brainstorm
  5. Drop copied-in codebases in favor of external dependencies
  6. Make sure every function you touch has some doxygen comments