Re: [foxboro] A Comment about comments

Chuck,
First of all 28 pages of code! I would hunt that person down and....  well,
never mind.

I too have seen this. I believe it has something to do with other comments
embedded in what you commented out. If that makes any sense? It can also be
a missing "curly brace" bracket.

As for finding the ENDIF missing. I print out the logic and pair up the IFs
and ENDIFs. It still requires a little time, but I usually find the missing
ENDIF on the first pass. It can be quite painful.

Mike Stewart Jr.
Control Systems Support
Automation/Simulation Specialist
Carrollton Site 
Dow Corning Corporation       


-----Original Message-----
From: foxboro-bounce@xxxxxxxxxxxxx
[mailto:foxboro-bounce@xxxxxxxxxxxxx]On Behalf Of Jones, Charles R.
(Chuck)
Sent: Tuesday, November 30, 2004 7:18 AM
To: 'foxboro@xxxxxxxxxxxxx'
Subject: [foxboro] A Comment about comments


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
 
 
 
_______________________________________________________________________
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: