From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4bd2a19251049b1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: best practice: error handling Date: Sat, 11 Jun 2011 15:57:23 +0200 Organization: Ada @ Home Message-ID: References: <0b95a2a1-6e3d-4ad1-a832-e3099a9bce37@v8g2000yqb.googlegroups.com> <1ulcworf418ai$.iy0mm08iuusy.dlg@40tude.net> NNTP-Posting-Host: fGpkzlUfcOSQVUiZJOXhgg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.11 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:20721 Date: 2011-06-11T15:57:23+02:00 List-Id: Le Tue, 31 May 2011 22:02:42 +0200, Dmitry A. Kazakov = a =C3=A9crit: > Again, the point is valid, but the example is not good. Zero index is = as > good as Index_Result. In both cases an attempt to use the index will = > cause > an exception. So both return an "invalid index." Disagree: an index is an index, not an error status; otherwise this is a= = kind of special-value as special-meaning (a special meaning which outsid= e = of the normal type semantic area). My experience says its dangerous, = because it is always hard to read that either -1 or 0 or who know what, = = was intended to mean Error. Chance are that many people will read 0 as = meaning =E2=80=9CIndex 0=E2=80=9D. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [Ep= igrams on = Programming =E2=80=94 Alan J. =E2=80=94 P. Yale University] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [Idem] =E2=80=9Cc++; /* this makes c bigger but returns the old value */=E2=80=9D= [Anonymous]