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,8276b2994037cd71 X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Re: disjoint ranges ? Date: 2000/10/23 Message-ID: <39F48116.35EE68C9@earthlink.net>#1/1 X-Deja-AN: 684905810 Content-Transfer-Encoding: 7bit References: <39E612C9.9BF98CD3@laas.fr> <39E79F17.24DB0828@pacbell.net> <39E7BB80.1AB10FE2@ix.netcom.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 972325150 198.94.156.19 (Mon, 23 Oct 2000 11:19:10 PDT) Organization: EarthLink Inc. -- http://www.EarthLink.net MIME-Version: 1.0 NNTP-Posting-Date: Mon, 23 Oct 2000 11:19:10 PDT Newsgroups: comp.lang.ada Date: 2000-10-23T00:00:00+00:00 List-Id: Lao Xiao Hai wrote: > ... > There are some in the world of object technology who believe that enumerated > types are a bad idea because they are an artifact of an old-fashioned style of > programming. This same criticism could be leveled at the whole issue of > range constraints. While the notion of a range constraints was a good one > when first introduced, it could be argued that the problem addressed by > a range constraint better can be solved with assertions. An assertion would > enable easy modeling of non-contiguous ranges. Of course, this also makes > the compiler a bit more complicated and introduces other problems. The > question is whether the new problems are worse than the old one being > solved. > ... Many criticisms of features are based upon the way that C++ implements the feature. This is not exactly fair, but is perhaps inevitable as C++ is the most commonly known language. Since Java is the second, and there is a large overlap between the user base, perhaps if C++ does a poor job of implementing a feature, and Java leaves it out, we can expect the feature itself to be criticized. The assumption that there is some basic "right" way to do things is probably wrong. It seems to me that there are a range of correct ways, some more suited to some problems, and others to others. It also seems that there are a range of ways to think, and that some are more suited to some programming constructs, and others to others. It's not really clear that one would gain anything by shoehorning a construct where it didn't fit naturally. Ada is designed, complex, intricate, reliable, "small", and, especially, Formal. This is seen in the Ada implementation of Objects as Tagged records. It makes perfect sense, after you think about it long enough. A tagged type makes explicit things which most implementations of Objects leave implicit. If you feel that these things should be implicit, then you are more likely to feel that the members of an enumerated type should be hidden behind the impermeable walls of a class. But there are lots of problems with that. The lack of enumerated types is one of Java's big weaknesses, even if I don't like the way that C handles them. -- (c) Charles Hixson -- Addition of advertisements or hyperlinks to products specifically prohibited