Should function declarations include parameter names? [closed]

While both are a-okay and used quite a lot, there is a distinct advantage to using parameter names in the declarations in your header files.

Most documentation systems (say, doxygen) will parse your header files and generate docs.
As an example, look here: http://libface.sourceforge.net/doc/html/classlibface_1_1_face.html

Look at the constructor documentation.

Compare this

Parameters:
    x1  X coordinate of the top left corner of the face.
    y1  Y coordinate of the top left corner of the face.
    x2  X coordinate of the bottom right corner of the face.
    y2  Y coordinate of the bottom right corner of the face.
    id  ID of the face. -1 not not known.
    face    A pointer to the IplImage with the image data. 

and this

Parameters:
    param1  X coordinate of the top left corner of the face.
    param2  Y coordinate of the top left corner of the face.
    param3  X coordinate of the bottom right corner of the face.
    param4  Y coordinate of the bottom right corner of the face.
    param5  ID of the face. -1 not not known.
    param6  A pointer to the IplImage with the image data. 

You get the point. 🙂

Leave a Comment

File not found.