• 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

Question.

Do you write comprehensive code comments, thus making the job much longer (kerrching) but making it much easier for someone else to pickup the code and replace you, or write cryptic comment free code that is quick to write (no contract renewal) but no bugger can pick it up (and get called back in on a new contract)?

I write comprehensive code comments that add value, thus making the job slightly longer (kerc) but making it much easier for someone else to pickup the code and replace me, while I get on with something more lucrative and interesting. :smokin
 
At a previous client a spend three days investigating why one of their services had stopped working. I tracked it down to an SQL call embedded in the following try/catch code:

Code:
try{
        ...lots of real code here
}catch(Exception e){
        // ignore, probably nothing
}

That comment certainly helped me :rolleyes:
 
Someone I know cut and paste some code from the internet (including comments) and put it in production code. The comments were in Spanish, but he thought he better leave them in.

During testing it was found that the code didn't work. After putting the Spanish comments through google translator it came out as "This code is an example, and I can't get it to work, not sure why" :bang: :rollin:

Post of the month!
 

Advertisers

Back
Top