Assertions in Production Code?

Assertions in Production Code?

Postby James Bott » Thu Sep 04, 2008 12:35 pm

This is an interesting article.

Assertions in Production Code?
http://dobbscodetalk.com/index.php?opti ... &Itemid=29

I must confess that I have been very lax in using assertions. I am considering spending more time on it.

Comments?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Thu Sep 04, 2008 1:12 pm

James,

Lets make a comparison with the security of a house:

You can place gates, security windows, alarms, security guards, etc. but will it be 100% totally safe ? Wouldn't there be a way to bypass all that security ?

I mean that we can minimize the risks as much as possible, but there will always be a failure percentage.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Thu Sep 04, 2008 1:44 pm

Antonio,

Oh, I agree. But some of the comments like:

>Professionally written production code is bug free, so there is no need for asserts.
>An assert firing causes the program to abort, which may not be permissible, may cause data loss, and looks unprofessional to the customer.

Really surprised me. That is just ignoring that there can be problems.

I think we need to find an acceptable middle ground. This point will vary depending on the consequences of the software failing.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Thu Sep 04, 2008 7:41 pm

James,

yes, I fully agree with you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to Off Topic / Otros temas

Who is online

Users browsing this forum: No registered users and 6 guests