I am programming using C++ and am wondering how to comment my project.
For example, when I declare a class I created a header with some description, then have the declaration stage, which I don't comment. Then when I define the actual functions I will put details about it, what it does, description of arguments etc.
I am programming using C++ and am wondering how to comment my project.
For example, when I declare a class I created a header with some description, then have the declaration stage, which I don't comment. Then when I define the actual functions I will put details about it, what it does, description of arguments etc.
Would be good to have people's opinion on this.
You should put the description in the header because that's where everyone's going to look. It means they don't need to hunt through hundreds of lines of source to find the function implementation they're interested in.
Besides -- if you ever distribute this code in library form, your users won't even have the source files, just the header and some objects.
I can put documentation for the interface (parameters, return value, what the function does) in the interface file (.h), and the documentation for the implementation (how the function does) in the implementation file (.c, .cpp, .m).
I can also document the interface (return values, argument, state changes, etc) before the member function implementation, and high-level architectural overviews in separate documents (to give a broader view of how everything is put together; it's hard to place this together with the code, since it usually references several classes at once).
I write an overview of the class just before its declaration, so the reader has immediate basic information.
All,
I am looking for a way to improve this small one liner.
one of the files has this kind of format
public func <<<T>(array: , offset: Int) -> { return array.shiftedLeft(by: offset) }
gsed -i '/public func/i /\/\/\public func \n/\/\==mark==public func' tresults in
///public func ... (5 Replies)
Hello All,
I am trying trying to write a shell script that will do a couple things:
1.) Identify any username that logs into the server.
2.) When the user logs out, send them an email detailing
their log in/out times, duration logged in, and what
processes they ran.
Basically,... (3 Replies)
I've been asked to do a high level summary of the cron jobs which run against a number of systems (to understand the potential scope for rewriting some of our core systems)...and was wondering how people have done this in the past.
I've got approx 400 cron entries to go through.
I will have... (2 Replies)
I've been working on a very long shell script that's becoming a mini-application. It is my first script, and continues to grow each week, becoming more and more complex.
I've been asked to document my script, beginning with basic information and then detailing any information about its... (1 Reply)