Code comments
-
How do you begin your code? Do you write comments at the beginning that tell who is the developer, the date, the name of the module?? I usually begin like this: ///////////////////////////// // fileName.cpp //Date: 09/04/2001 // Author: emanuele delbono // Version: 1.0 // Revision history // Date - Author // Comments: ////////////////////// And you?? Do you insert some sort of joke?? :-))
I personally don't believe in comments like this. It's just one more thing to maintain and to quickly become meaningless when just one person in a long chain of developers forgets. To me commenting code like this is a bit like using writeln's to debug - it was useful in its day, but not the best way of doing things now. This sort of information is one of the things that version control software was created for. Cheers, Tom Archer Author, Inside C# Best mini-putt score = 22
-
How do you begin your code? Do you write comments at the beginning that tell who is the developer, the date, the name of the module?? I usually begin like this: ///////////////////////////// // fileName.cpp //Date: 09/04/2001 // Author: emanuele delbono // Version: 1.0 // Revision history // Date - Author // Comments: ////////////////////// And you?? Do you insert some sort of joke?? :-))
Yes, I have stuff like that. But I don't include anything that the source control system automates. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
I use a VC++ add-in to generate .cpp/.h files. So every file has the same format that looks something like
#ifndef _REGISTRY_H_
#define _REGISTRY_H_
//****************************************************************************
//**
//** Registry.h
//**
//** Author : Todd Smith
//** Date : Mon Dec 10 10:21:58 2001
//** Notes : CMM lvl -1 compliant header
//**
//** $Id: Registry.h,v 1.5 2002/01/04 21:20:23 todd Exp $
//**
//****************************************************************************
//============================================================================
// INTERFACE REQUIRED HEADERS
//============================================================================Todd Smith CPUA 0x007 ... shaken not stirred
Todd Smith wrote: I use a VC++ add-in to generate .cpp/.h files. Todd, what add-in is this and where can I get it? Michael Martin Australia mjm68@tpg.com.au "Don't belong. Never join. Think for yourself. Peace" - Victor Stone
-
Todd Smith wrote: I use a VC++ add-in to generate .cpp/.h files. Todd, what add-in is this and where can I get it? Michael Martin Australia mjm68@tpg.com.au "Don't belong. Never join. Think for yourself. Peace" - Victor Stone
I use a modified version of this generate a .h and .cpp in the project dir (I can send a copy if you like) http://www.codeguru.com/devstudio\_macros/make\_file\_pair.shtml And then a slightly modified version of this to paste blocks of code into a file (one or .h and one for .cpp) http://www.codeguru.com/devstudio\_macros/code\_template\_sandy.shtml Todd Smith CPUA 0x007 ... shaken not stirred
-
I use a modified version of this generate a .h and .cpp in the project dir (I can send a copy if you like) http://www.codeguru.com/devstudio\_macros/make\_file\_pair.shtml And then a slightly modified version of this to paste blocks of code into a file (one or .h and one for .cpp) http://www.codeguru.com/devstudio\_macros/code\_template\_sandy.shtml Todd Smith CPUA 0x007 ... shaken not stirred
Todd Smith wrote: I use a modified version of this generate a .h and .cpp in the project dir (I can send a copy if you like) That would be much appreciated Todd. Michael Martin Australia mjm68@tpg.com.au "Don't belong. Never join. Think for yourself. Peace" - Victor Stone