FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Off Topic / Otros temas Assertions in Production Code?
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Assertions in Production Code?
Posted: 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

&

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Assertions in Production Code?
Posted: Thu Sep 04, 2008 01: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Assertions in Production Code?
Posted: Thu Sep 04, 2008 01: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Assertions in Production Code?
Posted: Thu Sep 04, 2008 07:41 PM

James,

yes, I fully agree with you

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion