RedSon 5,000
Recognized Expert Expert
So what do you guys use for headers to your files or headers for each individual method. If you write java don't respond to this thread.
Something like: -
////////////////////////////////////////////////////////////////
-
// File: foo.cpp
-
// Description: Takes a snarbleblart and applies the merkalanium transform to output a booblenortrox.
-
// Author: RedSon
-
/////////////////////////////////////////////////////////////////
-
-
et cetra, et cetra....
-
4 1056 Ganon11 3,652
Recognized Expert Specialist
Informally (as I'm only a high school student doing assignments for my teacher), my header looks something like - /* Chapter X, Exercise Y (or substitute for Exercise, as we may be working off of a handout)
-
Class Name (Independent Study), Name */
For some of my recent independent (read: fun) projects, I've bee adding a "Date last modified" section, a name, a brief description of the project and a mock "version".
For methods, I rarely comment, but when I do I include a brief description including what the function basically does, sometimes how it works, the postconditions and preconditions, and the return value - what it could be and what it specifies. So the comment might be (from my latest project, Chess): - // boolean whiteInCheck()
-
// whiteInCheck() loops through every possible space on board.
-
// If there is any piece that can legally capture the White King
-
// (it has 'line of sight' and is a Black piece), then the function
-
// immediately returns true. If the loops finish, then no piece
-
// threatens the White King, and there is no check. The function
-
// returns false.
-
// Pre-condition: board has been initialized to a 2D array of
-
// chessPieces (8 x 8)
-
// Post-condition: Indicates whether the White King is in check.
-
// returns: boolean - True = White King in check, false = No check
Informally (as I'm only a high school student doing assignments for my teacher), my header looks something like - /* Chapter X, Exercise Y (or substitute for Exercise, as we may be working off of a handout)
-
Class Name (Independent Study), Name */
For some of my recent independent (read: fun) projects, I've bee adding a "Date last modified" section, a name, a brief description of the project and a mock "version".
For methods, I rarely comment, but when I do I include a brief description including what the function basically does, sometimes how it works, the postconditions and preconditions, and the return value - what it could be and what it specifies. So the comment might be (from my latest project, Chess): - // boolean whiteInCheck()
-
// whiteInCheck() loops through every possible space on board.
-
// If there is any piece that can legally capture the White King
-
// (it has 'line of sight' and is a Black piece), then the function
-
// immediately returns true. If the loops finish, then no piece
-
// threatens the White King, and there is no check. The function
-
// returns false.
-
// Pre-condition: board has been initialized to a 2D array of
-
// chessPieces (8 x 8)
-
// Post-condition: Indicates whether the White King is in check.
-
// returns: boolean - True = White King in check, false = No check
And how far are you with this one?
Ganon11 3,652
Recognized Expert Specialist
And how far are you with this one?
Close - very close. I finished the rules for Castling this morning, then I'll have to make slight changes to the Pawn type, and then testing begins.
Close - very close. I finished the rules for Castling this morning, then I'll have to make slight changes to the Pawn type, and then testing begins.
You won't have to worry about where to get testers
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Quinton |
last post by:
I'm running a website that uses CSS to format the text and a CGI
program Coranto that icludes news updates via SSI. My problem is that
some parts of the CSS don't seem to take effect on the...
|
by: Matt |
last post by:
I am new to CSS. When we write the CSS for the position settings, do
we need to type it manually. Or it can be done by editor?
also, I want to make sure /* */ is the syntax to comment.
Please...
|
by: dan.vendel |
last post by:
Hi,
I know nothing about javascript, but quite a lot about regulat html and
CSS.
Have bumped into a problem that people in this fine congregation
perhaps can help me with.
I'm making a...
|
by: JezB |
last post by:
What's the generally accepted approach for using Styles and Stylesheets in a
web application based on .aspx files, Web Controls, User Controls, and
code-behind modules (c# in my case)? Most style...
|
by: sasquatch |
last post by:
Hi,
I've a a site with nested master pages and content pages. I tried using
a theme with a stylesheet in the app_themes directory referencing it in
the web.config file from a pages tag theme...
|
by: carolyn |
last post by:
I am trying to figure out if there is meaning to a comment "/* \*/" or if I
am reading too much into it. I am reworking some stylesheets and came
across the /* \*/ in the document a number of...
|
by: pocmatos |
last post by:
Hi all,
While I was programming 5 minutes ago a recurring issue came up and
this time I'd like to hear some opinions on style. Although they are
usually personal I do think that in this case as...
|
by: spolsky |
last post by:
hi,
it is possible to apply multiple styles as shown in the following
example.
<STYLE TYPE="text/css"><!--
BODY { background-color:salmon; }
P { margin-left:20px; }
.clsCode {...
|
by: matt urbanowski |
last post by:
Hi,
I have a calendar control on a form in VS2003 and have applied some
styles to it. I have separate styles for all of the groups e.g.
DayHeaderStyle, DayStyle, NextPrevStyle etc. and one for the...
|
by: splounx |
last post by:
Hi there,
I am a relative CSS & JavaScript novice and I have a particular
problem that is beyond my level of knowledge so I thought I'd tap the
collective wisdom of this group.
I would like...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |