Is there any program/module that shows the comments in the source code?

Posted on 2011-09-06
Last Modified: 2012-05-12
Hi there;

I am dealing massive amount code both in C# and Java.
The codes are very well commented but sometimes I add some silly comments to track during running.


Is there any program/module that shows the comments in total in the source code in C# and Java?

Kind regards.

Question by:jazzIIIlove
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 44

Accepted Solution

AndyAinscow earned 200 total points
ID: 36487522
When compiled the comments lines should be removed (just excess baggage, they don't do anything).
So if I understand your requirement correctly - no.

ps.  Comments are not the same as output to trace for example.
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 100 total points
ID: 36487565
For comments with // and /* there is no built in tool available. But for XML documentation (with ///) there is build in option there to generate the documentation file.

If you want to get the // and /* comments then write a program using regex.
LVL 47

Assisted Solution

for_yan earned 100 total points
ID: 36487633
If you need to track anything during runtime
you don't want to add comments but
you should add suh line

System.out.println("youur comment specifying the location in the program");  //printout

After you debugged your program it is easy to find all
lines with //printout
and delete them or comment them out from the start of the line

I am of course writing about Java; I'm sure you can do something similar in C#
LVL 44

Assisted Solution

AndyAinscow earned 200 total points
ID: 36487661
>>I'm sure you can do something similar in C#

Yes, it is called Trace (see the first comment)
LVL 86

Assisted Solution

CEHJ earned 100 total points
ID: 36487672
>>but sometimes I add some silly comments to track during running.

I assume you mean some kind of runtime output.

Any professional code has logging built into it. If you're using C# as well, i suggest using log4j and log4net

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java mysql insert application 14 44
VS 2013 installer,  Install, Update and uninstall via SCCM 6 44
C# Service FileSystemwatcher isse 9 46
Header Font Size in Grid View 6 24
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question