beautifying code
Falk Brettschneider
gigafalk at yahoo.com
Wed Sep 20 07:58:20 UTC 2000
Hi (Ralf || *)
Ralf Funken wrote:
>
> >I suggest we all should use nearly the same coding style in KDevelop
> >because it's quite ugly to see different styles in one file.
> >I would prefer a few rules:
> >
> >- prefix "m_" for class attributes
> >- prefix "p" for pointers
> >- prefix "m_p" for class attributes which are pointers
> >- upper case letters for each single word in a compound word: e.g.
> >KDevViewHandler instead of Kdevviewhandler.
> >- tab space = 3
> >- tabs replaced by spaces
> >- prefix "b" for boolean variables
> >- no prefix "get" at the beginning of a get function.
> >
> >Please, tell me your opinions. I just want to find a consense. :-)
> >
> >Cheers,
> > F at lk
>
> I'm not coding for KDevelop, however I have an opinion. Thank you for
> listening :-))
> I think it's a good idea to have one coding style. Falk's suggestions are
> quite near to the style we use in JAVA. There are two additional conventions:
> 1. function/method names always start lowercase,
Good.
> 2. variablenames are always completely lowercase (same as in C/C++)
Would be a contradiction to e.g. m_pKDevelopGUI
> I don't think it's a good idea to use tabs2spaces because it's very
> difficult to correct if someone uses a different tab spacing.
Yes, it must be set in the KDevelop editor settings to a unique value.
> Falk : Why do you want to eliminate the "get" prefix. IMO if an accessor is
> a getter it should be called like that.
To be closer to the Qt naming style that is used as well due using their
methods. AFAIK it's used in KDE, as well.
>
> One common code styling makes code more readable, easier to maintain and
> may help to find errors more quickly. So thumbs up from here.
>
> Some additional words about documentation
> While the user docus are great, the internal docu is really bad. I'm not
> talking about comments, this is done quite well, but about the absence of
> an API documentation. It's almost impossible to get an overview in an
> acceptable amount of time. Most of you have been with the project right
> from the start, so you know every single corner of it and may not even
> notice that. But other programmers have to actually read the code to learn
> which functions and interfaces are defined. To be honest, that was one
> reason for me not to touch a thing in it, I don't have the time and no
> ambitions to read 10000 lines of code. But maybe it's too late to change
> that now.
Good thoughts. It's not too late at the moment because it started from
scratch not long ago. BTW: These days John B. came up with the same
opinion...
Bye,
F at lk
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
More information about the KDevelop-devel
mailing list