Re: [SC-L] How can we stop the spreading insecure codingexamplesattraining classes, etc.?

2006-09-01 Thread David Crocker
Also, exceptions (unlike gotos) cannot be used to jump backward, thereby
creating hidden loops.

Used correctly, exceptions eliminate large amounts of code that would otherwise
be required to handle unexpected failures at every level in a function call
stack and propagate such failures upwards by way of return codes etc. to a point
at which some remedial action can be taken. Exceptions can certainly be misused,
but they are much better than the alternatives in many situations.

David Crocker, Escher Technologies Ltd.
Consultancy, contracting and tools for dependable software development
www.eschertech.com



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of der Mouse
Sent: 31 August 2006 22:45
To: SC-L@securecoding.org
Subject: Re: [SC-L] How can we stop the spreading insecure
codingexamplesattraining classes, etc.?


>> ever heard of exceptions?  They're basically goto plus limited state.  
>> Spaghetti lives!

Not at all.  Exceptions are not like gotos; in particular, an exception cannot
be used to jump *into* a construct.  The major problems with gotos are that they
can be used to do branches that are downward or sideways in the code parse tree
(versus "structured" constructs, which do such branches upward only).
Exceptions are upward-only branches, and as a result don't have most of the
problems gotos do.

/~\ The ASCII   der Mouse
\ / Ribbon Campaign
 X  Against HTML   [EMAIL PROTECTED]
/ \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
___
Secure Coding mailing list (SC-L)
SC-L@securecoding.org
List information, subscriptions, etc - http://krvw.com/mailman/listinfo/sc-l
List charter available at - http://www.securecoding.org/list/charter.php


___
Secure Coding mailing list (SC-L)
SC-L@securecoding.org
List information, subscriptions, etc - http://krvw.com/mailman/listinfo/sc-l
List charter available at - http://www.securecoding.org/list/charter.php


Re: [SC-L] How can we stop the spreading insecure codingexamplesattraining classes, etc.?

2006-08-31 Thread der Mouse
>> ever heard of exceptions?  They're basically goto plus limited
>> state.  Spaghetti lives!

Not at all.  Exceptions are not like gotos; in particular, an exception
cannot be used to jump *into* a construct.  The major problems with
gotos are that they can be used to do branches that are downward or
sideways in the code parse tree (versus "structured" constructs, which
do such branches upward only).  Exceptions are upward-only branches,
and as a result don't have most of the problems gotos do.

/~\ The ASCII   der Mouse
\ / Ribbon Campaign
 X  Against HTML   [EMAIL PROTECTED]
/ \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
___
Secure Coding mailing list (SC-L)
SC-L@securecoding.org
List information, subscriptions, etc - http://krvw.com/mailman/listinfo/sc-l
List charter available at - http://www.securecoding.org/list/charter.php


Re: [SC-L] How can we stop the spreading insecure codingexamplesattraining classes, etc.?

2006-08-31 Thread Gary McGraw
SYNTAX ERROR ON LINE 0:
> I take exception (haha!) at having them dismissed like this.  It
sounds like
KEYWORD "(haha!)" ILLEGALLY NEGATED
PLEASE RESUBMIT ARTICLE

gem




This electronic message transmission contains information that may be
confidential or privileged.  The information contained herein is intended
solely for the recipient and use by any other party is not authorized.  If
you are not the intended recipient (or otherwise authorized to receive this
message by the intended recipient), any disclosure, copying, distribution or
use of the contents of the information is prohibited.  If you have received
this electronic message transmission in error, please contact the sender by
reply email and delete all copies of this message.  Cigital, Inc. accepts no
responsibility for any loss or damage resulting directly or indirectly from
the use of this email or its contents.
Thank You.


___
Secure Coding mailing list (SC-L)
SC-L@securecoding.org
List information, subscriptions, etc - http://krvw.com/mailman/listinfo/sc-l
List charter available at - http://www.securecoding.org/list/charter.php


Re: [SC-L] How can we stop the spreading insecure codingexamplesattraining classes, etc.?

2006-08-31 Thread Pascal Meunier
I take exception (haha!) at having them dismissed like this.  It sounds like
you encountered some badly written exception handling code.  Error handling
can also be really bad, where at every call layer the original error gets
filtered or translated to a point where you just know something went wrong
somewhere but have little idea what.  Then you have to trace (yuck) and
waste hours trying to identify the problem.  I'll take limited state over no
state any day (Ruby even tells you which line numbers of which files were
involved).  

Pascal

On 8/31/06 8:29 AM, "Gary McGraw" <[EMAIL PROTECTED]> wrote:

>> as an industry we did manage to get
>> rid of computed gotos, spaghetti code, etc., so maybe there's
>> hope.
> 
> ever heard of exceptions?  They're basically goto plus limited state.
> Spaghetti lives!
> 
> gem
> 
> company www.cigital.com
> podcast www.cigital.com/silverbullet
> book www.swsec.com
> 
> 
> 
> 
> 
> This electronic message transmission contains information that may be
> confidential or privileged.  The information contained herein is intended
> solely for the recipient and use by any other party is not authorized.  If
> you are not the intended recipient (or otherwise authorized to receive this
> message by the intended recipient), any disclosure, copying, distribution or
> use of the contents of the information is prohibited.  If you have received
> this electronic message transmission in error, please contact the sender by
> reply email and delete all copies of this message.  Cigital, Inc. accepts no
> responsibility for any loss or damage resulting directly or indirectly from
> the use of this email or its contents.
> Thank You.
> 
> 
> ___
> Secure Coding mailing list (SC-L)
> SC-L@securecoding.org
> List information, subscriptions, etc - http://krvw.com/mailman/listinfo/sc-l
> List charter available at - http://www.securecoding.org/list/charter.php
> 


___
Secure Coding mailing list (SC-L)
SC-L@securecoding.org
List information, subscriptions, etc - http://krvw.com/mailman/listinfo/sc-l
List charter available at - http://www.securecoding.org/list/charter.php


Re: [SC-L] How can we stop the spreading insecure codingexamplesattraining classes, etc.?

2006-08-31 Thread Gary McGraw
>as an industry we did manage to get
>rid of computed gotos, spaghetti code, etc., so maybe there's
>hope.

ever heard of exceptions?  They're basically goto plus limited state.
Spaghetti lives!

gem

company www.cigital.com
podcast www.cigital.com/silverbullet
book www.swsec.com 





This electronic message transmission contains information that may be
confidential or privileged.  The information contained herein is intended
solely for the recipient and use by any other party is not authorized.  If
you are not the intended recipient (or otherwise authorized to receive this
message by the intended recipient), any disclosure, copying, distribution or
use of the contents of the information is prohibited.  If you have received
this electronic message transmission in error, please contact the sender by
reply email and delete all copies of this message.  Cigital, Inc. accepts no
responsibility for any loss or damage resulting directly or indirectly from
the use of this email or its contents.
Thank You.


___
Secure Coding mailing list (SC-L)
SC-L@securecoding.org
List information, subscriptions, etc - http://krvw.com/mailman/listinfo/sc-l
List charter available at - http://www.securecoding.org/list/charter.php