Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to add new folder button Pin
sansingh22-Nov-02 17:58
sansingh22-Nov-02 17:58 
AnswerRe: How to add new folder button Pin
Atlantys22-Nov-02 18:13
Atlantys22-Nov-02 18:13 
GeneralBitmaps Pin
Steven M Hunt22-Nov-02 17:14
Steven M Hunt22-Nov-02 17:14 
GeneralRe: Bitmaps Pin
Christian Graus22-Nov-02 17:26
protectorChristian Graus22-Nov-02 17:26 
GeneralThe Art of Writing Comments :: Software Engineering Pin
valikac22-Nov-02 17:11
valikac22-Nov-02 17:11 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
Matt Gullett22-Nov-02 18:03
Matt Gullett22-Nov-02 18:03 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
Hockey22-Nov-02 18:16
Hockey22-Nov-02 18:16 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
Ranjan Banerji22-Nov-02 18:07
Ranjan Banerji22-Nov-02 18:07 
You bring up a very interesting point. I hate writing comments too, however, I do write them. But I have to admit that my comments do not follow any specific methodology. I have seen code where each class has comments. Each function has detailed comments before the function etc. However, I have also found that some of these comments are very bookish. For example:

/* Function Name: SumOfBlah
Author : Son of Blah
Parameters/Arguments: int one and int two
Returns : int
Purpose : Adds one and two and returns the resulting value
*/

Or something like that. Now if the function were merely adding then these comments are OK. But if the function were not sum and instead was some complex algorithm such as "Determines the meaning of life." Then I find that merely stating that like in the sample above does very little for me. I need to know, how you determined "the meaning of life." i.e., comments should not be written for the sake of writing them, but more so to explain just what the hell is happening in there. Smile | :)

What I tend to do is write comments as I write the code. Just a few words to explain what and why I am doing.

And I have to say I love it when other developers do the same. I have had to deal with code with no documentation and no comments that dealt with various forecasting algorithms. And this code not only had no comments but used variables like i1, i2 ...etc. Goes without saying.... I rewrote the damn code rather than trying to fix the bloody thing. On the other hand I have found code well commented in Russian...no problem.... called a russian friend who told me what it said...and bingo!!! code fixed in a few hours. Comments do help.....

So where do I stand on comments:
1. A brief description for each function/class...if necessary
2. Comments in the code as I write the code. (very critical)
3. Write code in a self documenting manner, i.e., use class names, variable names, function names that make sense. (very critical)

Where do my bosses stand on Comments:
Those bookish comment blocks above each function which may or may not provide any useful information, but they look pretty, cover the bosses rear end, and provide the impression of well documented work... I hope they don't read this... Smile | :)

And by the way.... my comments have come to my own rescue, 2 years and 4 projects later. Its not always that easy to recall, why you did something... hehehehehehe Smile | :) Laugh | :laugh: Cool | :cool: ;)
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
Hockey22-Nov-02 18:12
Hockey22-Nov-02 18:12 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
valikac22-Nov-02 18:29
valikac22-Nov-02 18:29 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
Michael Dunn22-Nov-02 19:23
sitebuilderMichael Dunn22-Nov-02 19:23 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
Michael P Butler23-Nov-02 2:10
Michael P Butler23-Nov-02 2:10 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
Gary R. Wheeler23-Nov-02 2:58
Gary R. Wheeler23-Nov-02 2:58 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
valikac23-Nov-02 5:49
valikac23-Nov-02 5:49 
GeneralRe: The Art of Writing Comments :: Software Engineering Pin
loic28-Nov-02 1:52
loic28-Nov-02 1:52 
GeneralCOM+fopen - relative path Vs Absolute path Pin
devvvy22-Nov-02 16:57
devvvy22-Nov-02 16:57 
GeneralRe: COM+fopen - relative path Vs Absolute path Pin
Anders Molin23-Nov-02 0:45
professionalAnders Molin23-Nov-02 0:45 
Generalmemory slot and installed memory size/type Pin
JimBello22-Nov-02 14:18
JimBello22-Nov-02 14:18 
GeneralRe: memory slot and installed memory size/type Pin
alex.barylski22-Nov-02 18:24
alex.barylski22-Nov-02 18:24 
General'diff' algorithm Pin
moliate22-Nov-02 12:43
moliate22-Nov-02 12:43 
GeneralRe: 'diff' algorithm Pin
Shog922-Nov-02 13:05
sitebuilderShog922-Nov-02 13:05 
GeneralRe: 'diff' algorithm Pin
moliate22-Nov-02 15:29
moliate22-Nov-02 15:29 
GeneralRe: 'diff' algorithm Pin
Scott H. Settlemier23-Nov-02 6:32
Scott H. Settlemier23-Nov-02 6:32 
GeneralRe: 'diff' algorithm Pin
moliate25-Nov-02 8:58
moliate25-Nov-02 8:58 
Generalextracting dialog box to use in other program Pin
IrishSonic22-Nov-02 13:36
IrishSonic22-Nov-02 13:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.