Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.erje.net!news2.arglkargh.de!news.n-ix.net!news.belwue.de!news.uni-stuttgart.de!news.nask.pl!news.nask.org.pl!news.cyf-kr.edu.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail From: Michal Kleczek Newsgroups: comp.lang.java.programmer Subject: Re: About using assertion Date: Thu, 19 May 2011 15:16:54 +0200 Organization: http://onet.pl Lines: 19 Message-ID: References: <92r0e9F6lvU1@mid.individual.net> NNTP-Posting-Host: 87-205-150-44.adsl.inetia.pl Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: news.onet.pl 1305811015 13705 87.205.150.44 (19 May 2011 13:16:55 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Thu, 19 May 2011 13:16:55 +0000 (UTC) User-Agent: KNode/4.4.9 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4294 Lew wrote: > > That is wrong. That needs to be checked with an 'if' if 'NaN' is not a > legitimate input. 'assert' is not meant to correct things, only to make > sure I totally agree with you. > that the correction is documented and proven. If 'assert' is turned off > in production, you still have the bug if you use 'assert' as the only > guard. I was imprecise - just wanted to praise an example of "having confidence" being sooo wrong and how having assertions (even though they look redundant) _may_ help you. -- Michal