In one of my colleagues code review for c++, one of my team mates asked her to put an underscore for the beginning of the function since it was not exposed via the header file.
But I found it not compulsory(left to the programmer's style) for the following reasons:
- This was an old code base and none of the code followed this coding convention.
- This was a function name and not a method defined in the class.
- Most of my company uses Java and is much familiar with Java more than c++. Putting an underscore would create more confusion than clarity.
I think this question is quite subjective. Am I wrong here? Should we put an underscore for each function not exposed via header file?