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?? :-))
-
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?? :-))
Never start with anything like this. Usually a few #includes and a class declaration. WITHIN the class I work hard to comment everything, but nothng like the above. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
-
Christian Graus wrote: Never start with anything like this. Usually a few #includes and a class declaration LOL That is the clearest indication that CG has not worked for a CMM level 5 company yet... Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
Nish [BusterBoy] wrote: a CMM level 5 compan What's that ? Oh, and please go and look at my question in the C# forum :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
-
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?? :-))
Most companies have pre-defined comment headers. Mine does not, not yet. here we put whatever we want to. In my case often that comes to nothing Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
-
Never start with anything like this. Usually a few #includes and a class declaration. WITHIN the class I work hard to comment everything, but nothng like the above. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
Christian Graus wrote: Never start with anything like this. Usually a few #includes and a class declaration LOL That is the clearest indication that CG has not worked for a CMM level 5 company yet... Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
-
Christian Graus wrote: Never start with anything like this. Usually a few #includes and a class declaration LOL That is the clearest indication that CG has not worked for a CMM level 5 company yet... Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
-
Nish [BusterBoy] wrote: a CMM level 5 compan What's that ? Oh, and please go and look at my question in the C# forum :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
Christian Graus wrote: What's that ? That would be "Capability Maturity Model" something on the lines of ISO Certifications for quality. If you are in CMM Level 5 company, it would mean for writing three lines of code(i mean modifying an existing application and introducing new code) it would require one week of documentation. Cheers Kannan
-
Christian Graus wrote: What's that ? That would be "Capability Maturity Model" something on the lines of ISO Certifications for quality. If you are in CMM Level 5 company, it would mean for writing three lines of code(i mean modifying an existing application and introducing new code) it would require one week of documentation. Cheers Kannan
Confirming my suspicion that I want nothing to do with it :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
-
Nish [BusterBoy] wrote: a CMM level 5 compan What's that ? Oh, and please go and look at my question in the C# forum :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
CMM originally was created with an objective in mind: assess if you can give a project to a company and have it done right. After some years, people began using it to run their business, so they can be sure they are "CMM level 5". Let's see two actual samples of CMM in real world: Situation 1: Can you give a complex OS to a small company run by two nerds, running a CMM level 1 (worst level) company, like IBM did with MS ? Surely you won't have the work done. Example 2: If one person alone can code a small although complete UNIX kernel for your embeddedd application, like Linus Torvalds did. So, my conclusion is that by CMM we would never had: DOS, Windows Apple II, Macintosh ICQ Netscape, Internet Explorer CVS and so on... and by CMM all software in the world should be done by IBM. Right ? Crivo Automated Credit Assessment
-
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 start with something similar ( our coding standard insists so ) /*******************************.FILE_HEADER.*************** * .File: .xxxxx.c * .Version: .0.0 * .Project Code: .PROJECT * .Author: .Vimal * .Created on: .15 Mar 2002 ************************************************************ * .Summary: * .Note: * * .Revision History: bug fixes and optimizations * ***********************************************************/
-
CMM originally was created with an objective in mind: assess if you can give a project to a company and have it done right. After some years, people began using it to run their business, so they can be sure they are "CMM level 5". Let's see two actual samples of CMM in real world: Situation 1: Can you give a complex OS to a small company run by two nerds, running a CMM level 1 (worst level) company, like IBM did with MS ? Surely you won't have the work done. Example 2: If one person alone can code a small although complete UNIX kernel for your embeddedd application, like Linus Torvalds did. So, my conclusion is that by CMM we would never had: DOS, Windows Apple II, Macintosh ICQ Netscape, Internet Explorer CVS and so on... and by CMM all software in the world should be done by IBM. Right ? Crivo Automated Credit Assessment
Very neat way to portray how CMM sucks! Very good!!! :-) Nish p.s. I don't work for a CMM company by the way. Whew!!!
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
-
i start with something similar ( our coding standard insists so ) /*******************************.FILE_HEADER.*************** * .File: .xxxxx.c * .Version: .0.0 * .Project Code: .PROJECT * .Author: .Vimal * .Created on: .15 Mar 2002 ************************************************************ * .Summary: * .Note: * * .Revision History: bug fixes and optimizations * ***********************************************************/
I bet you work for a CMM certified company :-) Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
-
I bet you work for a CMM certified company :-) Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
Yes I do. Nish, I work at Nest, a CMM level 5 company in trivandrum. :)
-
Yes I do. Nish, I work at Nest, a CMM level 5 company in trivandrum. :)
Vimal Earnest wrote: in trivandrum Wow! A fellow Trivandrumite :-) Cool! Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
-
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 just go in for the simple approach which easily identifies the files as one of ours...
/*------------------------------------------------------------------*/
/* Filename: Filename.cpp */
/* Desc: A quick description of the purpose of this file. */
/* */
/* Date: March 2002 */
/* Author(s): David Wulff */
/* */
/* This file is Copyright 2002 Battleaxe Software Limited, and may */
/* .. not be used or redistributed without license. */
/* */
/* License: http://www.battleaxesoftware.com/license/ */
/*------------------------------------------------------------------*/If there are any important revisions made to a file that deserve their own comments, this would be added as a normal comment block underneath the heading or with the appropriate section of code. However (and this one *is* a touchy subject with devlopers), we use comment blocks for each function...
/*------------------------------------------------------------------*/
/* processInput */
/* Process the input events. Called at each frame start. */
/*------------------------------------------------------------------*/We even use these with obvious things like constructors as it makes it easy to tell the tsrta of anew function when you are scrolling quickly through a large file. ________________ David Wulff http://www.davidwulff.co.uk Sonork ID: 100.9977 Dave …
-
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 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
-
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?? :-))
It seems redundant to record the filename, author, date, version and revision history in the file itself when you are using a source control system. We don't have any kind of header on our source code, just #includes. Oh yeah we are ISO-9001 certified. Chris Hafey
-
Vimal Earnest wrote: in trivandrum Wow! A fellow Trivandrumite :-) Cool! Nish
My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org
Nish, I was just about to say, he would be working just a couple of blocks from your work place :-). Cheers Kannan
-
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?? :-))
Most our files start out with a header similar to what you have... except it's specially formatted to work with our version control system (PVCS) so that it automatically gets updated with the revision notes we type in. Functions usually have a couple lines explaining what they do (if not trivial), and what the parameters do (if not obvious.) For other blocks of code, I tend to comment WHY this code exists. That seems to be much more useful than just commenting WHAT the code does - that is often self-evident. For instance, you might find a comment like this: // Delete these registry entries becuase the API doesn't do it instead of // Delete HKEY_LOCAL_MACHINE/Software/App/Key :) Winning isn't everything, but then, losing is nothing.
-
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?? :-))