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,b0d68c502c0ae6 X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: Printing Enum Variable Re: Linux World Date: 1999/03/06 Message-ID: <7brec4$ti2$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 451886731 References: <7bfc2n$jl9@dfw-ixnews5.ix.netcom.com> <7bhh26$r7c$1@remarQ.com> <36DCAC1F.430E2C5E@aasaa.ofe.org> <7bk4v8$kl8$1@remarQ.com> <36DDA761.7B4E8099@aasaa.ofe.org> <7bkrmm$ao1$1@nnrp1.dejanews.com> <7bpevu$frn@dfw-ixnews12.ix.netcom.com> <7bpn1v$3kd$1@plug.news.pipex.net> X-Http-Proxy: 1.0 x9.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sat Mar 06 14:33:40 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-03-06T00:00:00+00:00 List-Id: > There is a point of view in the OOP community that says > that enumeration types arean artifact of an obsolete > style of programming. That is, an enumeration type, > because it is not extensible and cannot be further > specialized, is antithetical to OOP. Although I find > this viewpoint a little too narrow for my taste, one > could make a very good case to support it in many > situations. It is odd. Every few years, some new group of people rediscover Church's thesis. They develop a new paradigm and make the amazing discovery that they can manage to program any computing problem using this paradigm. They then conclude that one *ought* to use the paradigm 100% of the time, some examples are: goto-free programming top down structured programming applicative/functional programming data flow programming integration of correctness proofs logic programming ... and of course, most recently object oriented programming It's really a very puzzling phenomenon. If you step back and take a broader view, it is amazingly obvious that these narrow viewpoints are just that, narrow, and that the far more reasonable viewpoint is that we have a variety of paradigms, and should use the one, or the mixture that is appropriate to the problem at hand. Yes, of course it is problematic to use an enumeration type if one expects to make frequent changes to the set of values in a manner that does not really correspond to the abstraction in the first place. For example, it is a definite mistake to try to model errno across targets as an enumeration type, since the set of codes will change frequently, and it is simply unhelpful to use an enumeration type in this situation. On the other hand, complaining about type day is (Sun, Mon, Tue, Wed, Thu, Fri, Sat); on the grounds it does not allow for easy extension is good only for inclusion in a set of bad jokes. Extensible types and dynamic dispatching are certainly useful techniques *some of the time*. If you get into a way of thinking that ALL variant types and case statements must be replaced with this approach, you will create a mess for some problems where the case statements are more appropriate. This really is such obvious stuff that it should not need saying, but I still find that we are beset by fanatics who are singing the latest "do it my way, it is the only true way" song! Robert Dewar -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own