• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

code comments

christhecontractor

Still gathering requirements...
Thanks received
0
A guy I work with is constantly giving me a hard time about not commenting my code enough. Well, I was just fixing some of his code, and was looking at the comments he put in.

This is a contender for the most redundant comment I have ever seen:

// Send Message
SendMessage();

I'd say this comment is redundant too.
// now get the mantissa
int mantissa = FastMessageDecoder_ParseINT32();

For a start the 'now' is completely unnecessary. Of course it's now - it's not going to be next week is it. That leaves 'get the mantissa'. Well, duh!.
 
Thanks for reminding me why I don't socialise with programmers...

Thanks for reminding me why I don't use this web site - it hasn't changed.

Well to be pernickety.......

As far as we know RW doesn't socialise with programmers - TRUE

But you do use this web site.............

But hey - I expect a large minority of your programmer friends will have found your post interesting..... and also wouldn't want to socialise with RW
 
Well, if I was reviewing the muppet's code, it would get a fail. Comments are to add to the code, to make it clearer what's going on. Not to repeat what's already there.
 
Well to be pernickety.......

As far as we know RW doesn't socialise with programmers - TRUE

But you do use this web site.............

But hey - I expect a large minority of your programmer friends will have found your post interesting..... and also wouldn't want to socialise with RW

This is a logic puzzle isn't it?
 
A guy I work with is constantly giving me a hard time about not commenting my code enough. Well, I was just fixing some of his code, and was looking at the comments he put in.

This is a contender for the most redundant comment I have ever seen:

// Send Message
SendMessage();

I'd say this comment is redundant too.
// now get the mantissa
int mantissa = FastMessageDecoder_ParseINT32();

For a start the 'now' is completely unnecessary. Of course it's now - it's not going to be next week is it. That leaves 'get the mantissa'. Well, duh!.
My contender: a BAL program of several hundred lines. Only one comment: in the middle of a page of
CLC xxxx
BE yyyy

there was one BE that had the comment "BRANCH EQUAL".
 
Not programming I know, but that reminds me of steps in some written procedures I've had to rewrite:

6. Do this before the step above...
...
8. You might need to check the result.
...
14. You don't need the green binder.
 
Not programming I know, but that reminds me of steps in some written procedures I've had to rewrite:

6. Do this before the step above...
...
8. You might need to check the result.
...
14. You don't need the green binder.

Yes, exactly and some people write code like that - which is ok except when they insist I write it like that too - then it gets a little annoying.
 
Well to be pernickety.......

As far as we know RW doesn't socialise with programmers - TRUE

But you do use this web site.............

But hey - I expect a large minority of your programmer friends will have found your post interesting..... and also wouldn't want to socialise with RW

Well, I don't really use this site, this is the first time I've logged on in over a year. I guess I didn't realize that most people on the site aren't programmers. You're probably all agents aren't you! RW is not a nice chap. I bet he's an agent.
 

Advertisers

Back
Top