[Ktechlab-devel] Hidden functions.

P Zoltan zoltan.padrah at gmail.com
Fri Oct 23 22:24:06 UTC 2009


On Tue, 13 Oct 2009 19:38:02 +0200, Alan Grimes <agrimes at speakeasy.net>  
wrote:

> I had left connector.cpp open while I was doing other things, when I got
> back I noticed that I was looking at a function that isn't in the master
> list because it is not in any header file,
>
> int getSlope(float x1, float y1, float x2, float y2).
>
> I think ktechlab has a few dozen of these hidden functions that aren't
> browseable by kdevelop. =(
>
> Just as Cpp files should implement only one class, cpp files should also
> implement either functions or methods, never both!
>
> A great janitor project for a noob is to find all examples of these
> hidden functions, and move them to new cpp files and create headers for
> them and then add them to the appropriate path... This will allow them
> to be browsed by kdevelop and make them much easier to examine and debug.

  These are good ideas. Also I'd like to note that most of these functions  
are trivial, so there shouldn't be much bugs, but having a well organized  
source tree it quite useful.

>
> also, in the connector code, are a lot of methods that never accessed
> any class members, and are therefore, for all practical purposes,
> independent functions... =P

  What? Something is very wrong there...

>  I know OO is all the rage but many things
> are not inherently objects and, in the C++ universe should be
> stand-alone functions. In a true OO language, they would be grouped as
> static methods of an abstract class... they can be called but the class
> is never instantiated.
>

  That could be one method, but in C++ it could be good enough to have nice  
little C functions in separate files.





More information about the Ktechlab-devel mailing list