my first kdevelop plugin

Andras Mantia amantia at kde.org
Sun May 15 09:35:05 UTC 2005


On Sunday 15 May 2005 09:35, Jens Herden wrote:
> > > Sounds good at first glance, but I don't think you want me to
> > > critique the coding style. ;)
>
> Actually I really want feedback about coding style, because I want to
> learn about the KDevelop coding style. If there is no guideline about
> it, fine, but I did not see information about coding style for
> KDevelop. I admit I did not search very intense ;-)

I'd comment on the style, altought this is my personal taste and would 
like to be in Quanta code. I know that the project views plugin will 
become part of the KDevelop platform, not the Quanta language plugin, 
but I suggest to keep the coding style consistent per-plugin, not for 
the whole KDevelop. I say this because there are quite some 
contributors to the project, and many of them usually touch only one 
plugin and may have personal tastes that do not fit with the rest of 
the developers.
 So my comments are (partly from the Quanta's HACKING file):
- I'd not use spaces around parentheses (and it annoys me that KDevelop 
from trunk puts a space after function completion...). Anyway, the 
usage of it is inconsistent in your code, maybe due to the copy/paste 
of some parts from Quanta. ;-)
- same for the negation operator: "!something", not "! something"
- for const iterators I use:
UrlList::ConstIterator instead of UrlList::const_iterator
and constBegin/constEnd instead of begin/end. I haven't verified which 
one is preferred in QT4.
- I'd write inline methods inline, not as "inline class::method 
{ bla-bla }". The latter is only a hint for the compiler AFAIK and 
makes it hard to find where the body of the method is, because it it's 
not inside the class declaration itself, I'd search in the .cpp file, 
not at the end of the .h file
- use const QString& not const QString for arguments!
- use const for methods that are const (yes, I know I don't do every 
time, but it's easier to notice in someone else's code)
- I usually use the file name as the double-inclusion guard
- you email is jens@ not jens.herden@ isn't it so? ;-)

I compiled and will try later today. Now I have to go.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org




More information about the KDevelop-devel mailing list