Commenting
(posted by Fred Emmott at 2006-06-05 00:33:25)
// Preconditions: variable i in memory // Post conditions: variable i incremented by one // Method: // 1: fetch i from memory into register // 2: increase register value by 1 // 3: write value of register into memory i++;
Trackbacks
No trackbacks for this post
Comments
Indentation
Posted at 2006-06-05 01:11:56 GMT +0000 by "Obernardo"
// There's some indentation missing up there... Perhaps a \\ would do the trick.
You were...
Posted at 2006-06-05 04:06:16 GMT +0000 by "Me"
// While you were writing this comment your torch went out; you were eaten by a grue.
Missing essential information
Posted at 2006-06-05 08:56:16 GMT +0000 by "Groot"
// Returns value of variable i from step 1. But really, this should all be in Doxygen format instead.
Feels like overhead, but may not...
Posted at 2006-06-05 09:07:28 GMT +0000 by "Someone"
Yeah, comments which are separate from the real programming language and only interpreted by humans feel sometimes superflucious. But for precise programming they are somewhat needed. Minor nitpick: the specification would be with the definition of the increment function, not with an invocation ;)











/* Just a comment */
Posted at 2006-06-05 01:10:08 GMT +0000 by "Obernardo"
/* Stablishes a precondition to the operation */ // Preconditions: variable i in memory /* Establishes a post condition to the operation */ // Post conditions: variable i incremented by one /* Defines the method */ // Method: /* Defines step one */ // 1: fetch i from memory into register /* Defines step two */ // 2: increase register value by 1 /* Defines step three */ // 3: write value of register into memory i++;