Go Premium for a chance to win a PS4. Enter to Win


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

Posted on 2011-09-06
Medium Priority
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
LVL 45

Accepted Solution

AndyAinscow earned 800 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 400 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 400 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 45

Assisted Solution

AndyAinscow earned 800 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 400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

963 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