openAV-Luppp icon indicating copy to clipboard operation
openAV-Luppp copied to clipboard

Better commentation of classes and functions

Open georgkrause opened this issue 7 years ago • 10 comments
trafficstars

Althought the code is very easy to read and most a little more complicated lines of code are commented, its kind of hard to get the bigger connection in the code. Sometimes when i look for something, i dont need to know how a class or function works internally, its enough to know what it does. But since there are no information for most of the classes and functions, i need to read them to get the hole context.

Maybe this is just because i am not used to C++ but in general it might be an good idea to add some comments at least for new code to make it easier in the future to get into the code base.

georgkrause avatar Apr 02 '18 15:04 georgkrause

@georgkrause, so this issue is about adding docstrings to all classes and methods?

coderkun avatar Apr 02 '18 16:04 coderkun

Well, this would be amazing, but its a lot of work and since it does not bring any feature i dont know if someone is motivated to do this. My intention was more to remind everyone to maybe add one or two docstrings if one passes by...

georgkrause avatar Apr 02 '18 16:04 georgkrause

Do you have a source for good documentation regarding docstrings in C++?

coderkun avatar Apr 02 '18 16:04 coderkun

Is the problem really that the functionality of a class isn't known? Or is the real problem that it is hard to see how multiple classes interact, or what "owns" other instances? My reading of the 1st post is that the "overall design" is the hard part to understand, in which case the correct solution is to create a "design document", which details how the classes interact, and which classes are owned by which.

@georgkrause - would such a design document solve the issue you're having?

harryhaaren avatar Apr 02 '18 16:04 harryhaaren

Such a design document would be great! This would help me a lot.

But also if i read code i often dont understand what a class or function does, which isnt in my focus right now. so i need to read this, two. Having docstrings would help a lot on this issue. This is getting much better from time to time, so i want this comment stuff mostly for other users new to the project. if we all think about writing some docstrings when we edit a file, this should help a lot.

In general i think there is never too much documentation...

georgkrause avatar Apr 02 '18 16:04 georgkrause

@harryhaaren are you able to come to irc now? :)

georgkrause avatar Apr 02 '18 17:04 georgkrause

@coderkun and i thought of adding a Doxyfile to the repo, i already have one and could file a PR in the next days.

georgkrause avatar Apr 02 '18 17:04 georgkrause

@harryhaaren do you want docstring comments for classes/functions in the header or source files?

georgkrause avatar Jul 27 '18 07:07 georgkrause

@georgkrause, usually you add docstrings to both, in the header for what a class/method does and in the source file for how this is done.

coderkun avatar Jul 27 '18 08:07 coderkun

@harryhaaren ^^ ?

georgkrause avatar Aug 22 '18 20:08 georgkrause