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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,203d1f2317947ef5 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: others clause Date: 1996/09/03 Message-ID: #1/1 X-Deja-AN: 178324795 references: <3227AAA6.67C9@ghgcorp.com> <50d4fc$elf@fozzie.sun3.iaf.nl> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-09-03T00:00:00+00:00 List-Id: "Mike Bishop (mbishop@ghgcorp.com) wrote: `` In fact, using others is a good idea even when all values are explicitly covered. If you add more values to the type but forget to modify the case statement, you can still handle the new values in the others choice. ''" This seems a terrible idea to me. One of the great advantages of the case statement in Ada is precisely the check that you have explicitly covered every alternative. I prefer to avoid others choices whereever possible, and instead write out the list of alternatives that corresponds to what naturally might otherwise be written as others. Then each time you add a case, your compiler forces you to visit each case statement and think about whether or not it belongs in the "others" branch.