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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,acfbe6f43430943b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon02.news.prodigy.net!prodigy.net!newscon05.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr13.news.prodigy.net.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: Subject: Re: Type declarations problematic? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response Message-ID: NNTP-Posting-Host: 70.134.110.231 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr13.news.prodigy.net 1167892216 ST000 70.134.110.231 (Thu, 04 Jan 2007 01:30:16 EST) NNTP-Posting-Date: Thu, 04 Jan 2007 01:30:16 EST Organization: SBC http://yahoo.sbc.com X-UserInfo1: O@Y[R^[GZRRER_H]]RKB_UDAZZ\DPCPDLXUNNHDK@YUDUWYAKVUOPCW[ML\JXUCKVFDYZKBMSFX^OMSAFNTINTDDMVW[X\THOPXZRVOCJTUTPC\_JSBVX\KAOTBAJBVMZTYAKMNLDI_MFDSSOLXINH__FS^\WQGHGI^C@E[A_CF\AQLDQ\BTMPLDFNVUQ_VM Date: Thu, 04 Jan 2007 06:30:16 GMT Xref: g2news2.google.com comp.lang.ada:8072 Date: 2007-01-04T06:30:16+00:00 List-Id: "Maciej Sobczak" wrote in message news:ek69qv$oo0$1@cernne03.cern.ch... > Hi, > > http://www.joelonsoftware.com/items/2006/10/12.html > > "[it] seems to be that it's explicit typing, where the programmer is asked to > declare the type of things, that leads to most of the problems. > > [...] it's starting to look like type declarations are one of those accidental > difficulties that good programming languages can eliminate." > > > It is obvious that there is a place for dynamically typed languages, but the > above statements seem to be a bit too far-fetched. Do they mean that > "typeless" languages will just suck some of the Java audience (fine for me), > or is it maybe a more general problem that will drive the evolution of > programming languages further away from strongly typed systems? > Do you plan a switch to Ruby? ;-) > A class is a type. It is a very special kind of type, but still a type. Ruby, and other object-oriented languages do use classes. Just as we create instances of types, so too do we create instances of classes. Ruby, Python, and a lot of functional languages use reference implementations of primitive types as well as for classes. Java uses by value semantics for primitive types, and class objects are implemented by reference. Types are in place whether evaluated dynamically or statically. Perhaps the question is better asked in terms of static typing. Also, one needs to understand what is required of the problem space. Does safety make a difference? Is it useful to use a type-safe language? How type-safe do we need to be. C++ and Java are moderately type-safe, but with lots of little surprises for the newbie or naive programmer. Does the fact that a language is by-default type-safe (e.g., Ada) make it difficult to relax the default? No. Ada has a lot of mechanisms for relaxing type-safety. It is difficult to take a language where the default is unsafe and make it safer. We have a continuum of typing, well supported by Ada. Not as well supported by a lot of other languages. Assertions are a part of the type system. Invariants are part of the type system. An invariant defines the legal set of states for instances of a primitive type, abstract data type, or class. A type: 1) has a name (explicit or implicit) 2) a set of legal states (values) 3) a set of legal operations 4 a set of rules (language defined) with regard to relationships with instances of other types The fact that an entity is not given a type name does not mean it is not typed. Also, the four properties just described are general enough that lots of instances of things can be included, even things that seem to have no type at all. Richard Riehle