Jan Schreuder on .Net

.Net code samples, experiences, observations

View my professional profile on LinkedIn

Recent Posts

Tags

News

  • Inappropriate comments will be deleted at my discretion.

    The information and code samples in this weblog is provided "AS IS" without warranty of any kind, either expressed or implied, including but not limited to the merchantability and/or fitness for a particular purpose.

Community

Email Notifications

Tool suppliers

Tools

General

Microsoft

Favorite blogs

Archives

I thought I'd seen it all...

In the project I'm working on now, we use XML documentation in our code. This morning we tried to compile a release mode version of the project, because we needed to build a test setup version.

The compiler suddenly complained about missing XML comments. When we checked the source we found this:

// ///


// /// Creates an instance of the Crypt class
// ///

A programmer, who will remain anonymous, commented the XML comments! He had problems compiling the application (like we now have) and tried to solve it by commenting the XML comments.

Comments

Jan Schreuder said:

The programmer probably had no comment to that ;-)
# January 25, 2005 11:24 AM

Jan Schreuder said:

Well... I know why he probably did this :)

He had a public method. Public methods require XML documention comments (if you configured your project to do so). When you comment the public method the XML documentation will generate an error. So then you set the method in comment with its XML documentation tags.

The same for getting a certain coverage level. You can remove it and rely on your repository when you would need it again in the future or just put it in comment.

Nothing wrong with that. Probably someone else decided to add the method again but forgot to uncomment the XML document tags :)

That is why I would LOVE a keyword that just wont include the method when compiling.
# January 25, 2005 11:45 AM

Jan Schreuder said:

A valid explanation, but that hits on another issue. You usually have Source Safe, or another source revision tool. So why comment methods and leave them in the code. If it's not used, it's not supposed to be there.

# January 25, 2005 12:35 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 2 and 8 and type the answer here: