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

C / C++ / MFC

 
Generalmanually highlight a node in a tree control. Pin
trustno122-Nov-02 18:05
trustno122-Nov-02 18:05 
GeneralRe: manually highlight a node in a tree control. Pin
Michael Dunn22-Nov-02 19:25
sitebuilderMichael Dunn22-Nov-02 19:25 
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 
There was a time not too long ago that I would have agreed that comments are tedious and at best a "necessary evil".

kuphryn wrote:
Nonetheless, comments are tedious! For example, let say you spend an hour on an algorithm. Now, you have to spend another ten, twenty, even thirty minutes commenting the class or a collection of classes. In the end, you have less time solving other problems.

One thing I have learned that helps me quite a bit is this. Anytime I have need to write a new class, start by commenting the class and then writing the code with inline comments. (By inline comments, I mean comments on important lines.)

kuphryn wrote:
get so caught up in solving problems that I ignore the comments

I might add that by not commenting you are only introducing future problems.

kuphryn wrote:
Lastly, is there an art to writing good comments? How do you know where, when, and what to write such that the comment is elegant and takes up little time and effort because it becomes natural?

For me it has taken a very long time (years) to get to the point where I comment first and then code. I have learned that this helps me in several ways not the least of which is it helps me to remain focused on the implementation I have chosen and not to try and gold-plate it or (wing it) as I go. The key to doing this, though is knowing in advance what I am going to write and not writing it until I have it figured out in my head or sometimes in a testbed.

Once I made the leap from the "code a solution" to "design a solution and then code it" it became clear that commenting had to come first.

Anyway, that's just my 2 cents.
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 
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 

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.