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,751584f55705ddb7 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Side-effect arithmetic again [was: Ada ... in embedded systems] Date: 1996/04/01 Message-ID: #1/1 X-Deja-AN: 145238465 references: <4iq4k7$1p6@fozzie.sun3.iaf.nl> <4jkfpj$jl1@dayuc.dayton.saic.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-04-01T00:00:00+00:00 List-Id: In article <4jkfpj$jl1@dayuc.dayton.saic.com>, John G. Volan wrote: >...but (2) not >everyone who is involved in the development of software is necessarily >a professional programmer that's doing the actual coding. IMHO, the >fewer obstacles to understanding we put in the way of these associated >folks, the better things will be all around. But perhaps that's a >minor point. OK, fair enough. Perhaps I shoudn't have been so strident in my earlier post. But let's not go from the above, to trying to sell Ada by saying it's so "self documenting" that anybody can understand it. >Oh, I don't think it's as bad as all that. Instantiating a generic >isn't all _that_ big a deal, and for beginners it can simply be an >incantation that they can come to understand later. But perhaps you >have a point that something as "simple" as side-effect arithmetic >shouldn't warrant a generic -- but where do you draw the line at >"simple"? Is I/O too "simple" to warrant having to instantiate >Text_IO's generic subpackages; should we have had something analogous >to printf instead? Well, I don't know. It *is* a problem for teaching Ada, to have to introduce generic instantiations very early. It's true that you can just tell the beginner to type some magic incantation, and that's what everybody does, but it makes the beginner uncomfortable. The beginner wants to understand everything in the program. I wouldn't advocate printf, though -- it is inherently type unsafe. Other solutions are possible. Of course, Ada 95 has predefined instantiations for type Integer and so forth. And there's always 'Image. >...Is deallocating a heap object too "simple" to >warrant having to instantiate Unchecked_Deallocation, or should we have >had a built-in free or delete operation? No, I don't think so. >... Is breaking the strong typing >system when you need to too "simple" to warrant having to instantiate >Unchecked_Conversion, or should Ada have just allowed arbitrary type >conversions? No, certainly not. >Yes, that's a good technique, one that I've actually used in my own >code, now that I think about it. More people should realize that any >sort of type, even scalar types, can be endowed with new _primitive_ >subprograms which can be _inherited_ by derived types. This was true >even in Ada83. For all that Ada83 was branded as an "object based" >language, but not an "object oriented" language, people should give >Ada83 credit for actually having _inheritance_, even though it didn't >have Ada95's mechanisms for type-extension and classwide polymorphism. The "brand" was pretty fair, since polymorphism is pretty important. - Bob