Code that needs some love/refactoring

nik klebezettel at gmx.net
Mon Mar 9 20:13:55 CET 2009


Hiya!

I'm new to KDE Development. Reading some books about Code Refactoring 
and Design Patterns, I'm interested in code that needs some love :)

For example code that works but is difficult to read/understand and 
therefore could need some restructuring. Simple examples are:

    - big classes that have to much behaviour/methods
    - long methods
    - complicated logic that could be clearer by splitting it up
    - bad names
    - a source (directory) tree that could be better organized

Don't get me wrong. I don't want people starting to blame each other.  
It's nothing special that code declines with time. Somebody designs, 
then there is a change here and there and after a time you notice that 
the initial design is outdated because all the small changes together 
does not support the design.  Things work, never mind? Well, every (new) 
change needs understanding of the code. If the code is well 
structured/designed then it's easy for the (new) developer to become 
acquainted with it. As a result, it's easy to fix bugs and implement new 
features.

Now, don't point me to file xyz.cpp and class FooBar. I'm wondering if 
there is some infrastructure for this since I didn't find it. A place, 
where some experienced kde developers points other (new) interested 
developers to such code. Just a list of files with some remarks...like 
"Hey, if you are going to work on these files, consider to refactor some 
things..."

Maybe there could be some section for each project at 
http://techbase.kde.org/Projects . Or just one big page with a table for 
all affected files/classes.

Changing code is always risky since new bugs can be introduced. Because 
of this it's necessary to write tests before the refactoring. And hey, 
tests are a good thing, right?

Just an idea. Any Comments?


More information about the kde-quality mailing list