Adding a section "Touching old code" to the Kdelibs Coding Style (was: Re: [PATCH] Set program icon name by KAboutData)
Friedrich W. H. Kossebau
kossebau at kde.org
Mon Apr 21 15:02:27 BST 2008
Am Montag, 21. April 2008, um 14:54 Uhr, schrieb Aaron J. Seigo:
> On Sunday 20 April 2008, Friedrich W. H. Kossebau wrote:
> > Which could ask me to adapt the whole file, as I wrote the code by
> > example (TM). But that would kill "svn blame". So now go for mixed style
> > in a file?
>
> when we first came to the agreement for the kdelibs style it was also
> generally agreed (as in "never made into an official policy, just
> discussed") that we would improve code to follow the style guide as we
> touched it. so if a method was significantly changed, we'd redo the method;
> if it just touches as few lines, then the local context would be improved.
>
> this was a compromise between moving to the new style in all kdelibs code
> and not killing svn blame's usefulness.
If this was the generally agreement let's finally turn this into a written
rule, so there is a stick to beat everyone into behaving this way, eh, to
give a guide to them.
What about adding the following section to
http://techbase.kde.org/index.php?title=Policies/Kdelibs_Coding_Style
(please improve the english):
--- 8< ----
== Touching old code ==
You improve old code to follow the style guide as you touch it. If you change
a method significantly, you redo the whole method; if you just touch a few
lines, then you improve just the local context.
Code in kdelibs was historically created in a mix of personal coding styles.
As the commit annotation function of subversion (<tt>svn blame</tt>) operates
on a per-line base a complete adaption to the official coding style would
have turned this function unusable for too large parts.
--- 8< ----
Friedrich
More information about the kde-core-devel
mailing list