[foxboro] A Comment about comments
- From: "Jones, Charles R. (Chuck)" <Chuck.Jones@xxxxxxxxxxxxxxx>
- To: "'foxboro@xxxxxxxxxxxxx'" <foxboro@xxxxxxxxxxxxx>
- Date: Tue, 30 Nov 2004 06:17:48 -0600
Hello, All
This "discovery" may be news to some or a reminder for others...
Last Friday I had to troubleshoot code written by someone else. The code
was 28 pages long and had a missing ENDIF somewhere. A real man can find a
missing ENDIF just by reading through the code, right? ("Piece of cake", I
thought--for about an hour.) I eventually resorted to the beginner's method
of commenting out sections of code to isolate the error.
The code used a lot of the Pascal-style "curly brace" comment delimiters --
{ like this }. So, I also used them to isolate sections of code. I blocked
out the top half of the code and did not find the error. I kept dividing up
the bottom half until there was nothing left to divide. So, I began again.
This time, I blocked out the bottom half first and still did not find it.
Where else could it be?
About that time, I noticed that errors were showing up INSIDE THE AREA I HAD
COMMENTED OUT. WTF? How can that happen? I replaced my Pascal-style
comment delimiters with C-style delimiters -- /* like this */. I
immediately got the expected results.
It seems that not all comments are invisible to the compiler. So, why do
Pascal-style comment delimiters seem to kind-of, sort-of usually almost
always work? Who knows? I just won't use them for troubleshooting any
more.
Chuck Jones
Refinery Automation Technologist
Tate & Lyle -- Lafayette South Plant
765.477.5324 - Office | 877.536.9219 - Pager
"What I used to know, I forgot."
*****************************************************************************************************
This email and any files transmitted with it are confidential and intended
solely for the
use of the individual or entity to whom they are addressed. If you are not the
intended
recipient or the person responsible for delivering the email to the intended
recipient, be
advised that you have received this email in error that any use, dissemination,
forwarding, printing, or copying of this email is strictly prohibited. If you
have received
this email in error please notify the sender immediately. Please note that we
reserve
the right to monitor and read any emails sent and received by the Company in
accordance with and to the extent permitted by applicable legal rules.
*****************************************************************************************************
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
Other related posts:
- » [foxboro] A Comment about comments