Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
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!
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"
This one will go in my book. Thank you. Just imagine how much of this crap actually reaches production environments because of Clients using numpty ' testers' from Accidenture, Cack Gemini and the like. I once challenged a ClientCo to let me test a copy of their production systems for a day. Some of the bugs I found scared the tulip out of them and it included things that should have been found in five minutes of testing, like a pension fund sending double requests to market traders, a telco whose user authorisation for management of a national network could be hacked by signing into admin apps as an unauthorised user and clicking through a couple of error messages, at which juncture you could remove the DB owner with all the horrific consequences.
And what exactly is wrong with an "ad hominem" argument? Dodgy Agent, 16-5-2014
One client used CheckStyle to ensure the code was 'compliant' with its coding standards before you could commit to CVS. The other devs would faithfully write out long useless comments, but I just did this:
/**
* Accessor method.
*/
public String getPostcode() {
XML comments in .NET are useful for generating documentation using NDoc and for intellisense in the IDE, so they are a good idea.
But rather than write comments in the body of the code, why not spend the time saved writing comprehensive unit tests and robust error handling instead?
XML comments in .NET are useful for generating documentation using NDoc and for intellisense in the IDE, so they are a good idea.
Funny you say that, because the C# project I've inherited has some comments like that, and as you say it's useful for tooltips and the like in the IDE if nothing else. But it doesn't agree with the code standard, so I'm having to change them to a format that doesn't work with the IDE.
One old project I work on has a fair amount of "TODO: Write the purpose of this function" comments, which come from VC++ I think. It also has several "Take this bodge out" comments - although I'm probably responsible for some of them.
The thing that annoys me the most is finding blocks of commented out code with no explanation as to why. Is it something essential that's been temporarily removed, or is it an experiement that didn't work? Who knows?
Comment