473,790 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A thought on Comments

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.

Nov 21 '05 #1
5 1147
Hi,

The comments are not compiled.

Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
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.


Nov 21 '05 #2
Thought so I just wanted to check!

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ej******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

The comments are not compiled.

Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
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.



Nov 21 '05 #3
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
Nov 21 '05 #4
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" <fi*****@m-turner.co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
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.

Nov 21 '05 #5
"Michael Turner" <fi*****@m-turner.co.uk> schrieb:
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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3379
by: Sims | last post by:
Hi, I proud myself in having good comments, (/**/, // etc...), all over my scripts as well as a very descriptive section at the beginning of the script. No correct me if i am wrong but php must still 'read' those comments? So, do comments technically slow the whole process? Or is the loss of CPU/Time/memory so negligible that i do not need to worry about it.
4
10940
by: Uwe Ziegenhagen | last post by:
Hello, my fellows and me implement a c++ tool that is able to divide blank/tab separated files into <number>, <text>, <c-singlelinecomment> and <multilinecomment>. So far it's not working bad, we have just one problem if I call the a.exe that gcc compiles with the following textfile (./a.exe < test.txt) he does not match the multiline comments correctly. *test.txt contains:
28
3465
by: Benjamin Niemann | last post by:
Hello, I've been just investigating IE conditional comments - hiding things from non-IE/Win browsers is easy, but I wanted to know, if it's possible to hide code from IE/Win browsers. I found <!> in the original MSDN documentation, but this is (although it is working) unfortunately non-validating gibberish. So I fooled around trying to find a way to make it valid. And voila: <!--><!><!-->
40
4645
by: Edward Elliott | last post by:
At the risk of flogging a dead horse, I'm wondering why Python doesn't have any multiline comments. One can abuse triple-quotes for that purpose, but that's obviously not what it's for and doesn't nest properly. ML has a very elegant system for nested comments with (* and *). Using an editor to throw #s in front of every line has limitations. Your editor has to support it and you have to know how to use that feature. Not exactly...
7
1888
by: Bob Stearns | last post by:
Several weeks ago I asked what comments I could pass to DB2 in a SELECT statement. I don't remember whether I said via PHP/ODBC. I was assured that both /* */ style comment blocks and -- comment lines were allowed. Unfortunately, neither work. Both -- and /* */ comments cause a "premature end of statement". Any sage advice?
4
2373
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of which I mean here. Just for a moment, let's just take one definition for one of the
98
4627
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
40
2682
by: jacob navia | last post by:
Recently we had poor Mr "teapot" that was horrified at the heresy of lcc-win of accepting // comments. C is a nice language, and you can do anything with it, inclusive a program that transforms // comments into well behaved /* ... */ ones... ------------------------------------------------cut here /*
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.