KDE/kdevplatform

David Nolden zwabel at googlemail.com
Sun Feb 24 00:34:13 UTC 2008


On Sunday 24 February 2008 01:10:50 Andreas Pakulat wrote:
> Does this gain anything except fewer classes in the API? IMHO such API
> changes should be discussed on the list instead of being decided simply
> by you.
>
> The naming of the Declaration class(es) is now completely wrong as they
> might also be definitions. No amount of apidox can help with such bad
> namings.

The thing is, that it was exactly the same way before. A declaration could 
always be a definition. There was always isDefinition(..). There just was an 
additional Definition class, and it wasn't clear when exactly to use 
Definition and when Declaration with isDefinition.

So essentially this is nothing more then removing a redundant class.

> Also I don't quite like the look of:
>
> void doSomething(Declaration* decl) {
>
> Declaration* def = 0;
> if( decl->isDefinition() ){
> def = decl;
> } else {
> def = decl->definition();
> }
> ...
> }
>
> instead of just
>
> void doSomething(Definition* def) {
> ...
> }

As said, it's not much different from before, essentially it's less code for 
the same result.

Btw. are we planning to support any other language except C++ that 
differentiates between Declaration and Definition?

Of course we could resurrect the Definition class, the thing is just that you 
gain nothing from it. In C++ the Definition class like it was simply does not 
make sense.

Greetings, David




More information about the KDevelop-devel mailing list