Turn on thread page Beta
 You are Here: Home

# A2 Computing Coursework watch

1. Do you have to annotate every line of code? Or just the procedures and their functions?
2. Although I'm only an A1 student, I'm a pretty enthusiastic coder, and I'd say that the over commenting of code is something that starts to make code harder to understand. As as basic guideline I usually do this:

Code:
```#include <stdio.h>
int bitsetq(int n, int b) {
/* A truth test to check whether bit "n" of the binary
representation of dernary b is 1 */
int index=0;
int bin[50]={0};
do {
bin[index++]=b % 2; /* mod 2 to give remainder */
b /= 2;
}
while ( b / 2 != 0);
bin[index]=b;
if(bin[n] == 1)
return 1;
return 0;
}

int main(void) {
if(bitsetq(1, 10))
printf("True");
else printf("False");
}```
That just describes where the code's a bit trickier to understand, or basic function purposes.

However, you sometimes get code like:

Code:
`i++; /* Increase i by 1 */`
Which is just overkill, the examiner, or whoever's marking it isn't stupid, and will understand that. Lots of comments make code hard to read.

I'd recommend commenting basically, where you had to think about the code to get it to work, and what each function does. If you've got a particularly tricky array that you're working with, a brief description of what the array does is always useful.

Hope this helps,

Rob.
3. LOL every line of code? that would take me a long time, no just local procedures explaining what they do
4. ummmmm the A2 is centre assessed
you must remember that the code/solution is just as worth as much as the analysis.
5. hey guys i am an A2 student as well
so what was the end result do we annotate each line or the procedures. hey i have only got 3 weeks before handing the final piece you better be quick lol.........
well i have go a very complicated sysytem and tehrefore there is a lot of code involved. so what do you say..............
K-OSS

Turn on thread page Beta
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: March 3, 2004
Today on TSR

### Congratulations to Harry and Meghan!

But did you bother to watch?

### Why are girls so attracted to tall guys?

Poll

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE