A thought on Comments

  • Thread starter Thread starter Michael Turner
  • Start date Start date
M

Michael Turner

Hi Guys

I am currently working on a project and it is constantly being updated, when
I change code I normall comment out the old line(s) and then retype my new
code, just incase I need to revert back, I normally clear this down when
finished but sometimes it gets left in, I was just wondering if comments in
code slow down the performance of the program. Or if the compiler leaves
these out.

Mike.
 
Hi,

The comments are not compiled.

Ken
---------------------
Hi Guys

I am currently working on a project and it is constantly being updated, when
I change code I normall comment out the old line(s) and then retype my new
code, just incase I need to revert back, I normally clear this down when
finished but sometimes it gets left in, I was just wondering if comments in
code slow down the performance of the program. Or if the compiler leaves
these out.

Mike.
 
Michael,

It does nothing with your code however it let me think on a program I once
had to maintanance in far past what was 10cm thick of pages and that was
full with comments and partially with comments deleted code as you said.

It was unreadable, when I was ready (I just made it new) there where (as far
as I remember me) basicly 4 pages left.

Because the unreadability there where a lot of functions which where double
done and a lot of functions where active however the results were never
used. The new program was 4 times faster and that were no milliseconds in
that time.

Just to give you an idea

Cor
 
In addition to Cor's suggestions, you may wish to look into a number of
tools such as:

Visual Source Safe or WinCVS for version control
Ndoc and VBcommenter for code documentation

All are either a google away or can be found on sourcforge.com or
gotdotnet.com and they will go a long way to cutting through the
obsfurcation.
 
Michael Turner said:
I am currently working on a project and it is constantly
being updated, when I change code I normall comment
out the old line(s) and then retype my new code, just incase
I need to revert back, I normally clear this down when
finished but sometimes it gets left in, I was just wondering
if comments in code slow down the performance of the
program. Or if the compiler leaves these out.

The compiler leaves them out and they thus don't slow down the runtime
performance of your application. Nevertheless, compilation time may be
higher if there are loads of comments spread over the code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top