Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site tekchips.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!vax135!cornell!uw-beaver!tektronix!tekchips!stevev From: stevev@tekchips.UUCP (Steve Vegdahl) Newsgroups: net.lang Subject: Re: Whats wrong with strong typing Message-ID: <477@tekchips.UUCP> Date: Wed, 14-Dec-83 12:38:41 EST Article-I.D.: tekchips.477 Posted: Wed Dec 14 12:38:41 1983 Date-Received: Sat, 17-Dec-83 02:22:02 EST Organization: Tektronix, Beaverton OR Lines: 47 >>It's an incomplete facility ... [providing] a small, essentially arbitrary >>set of assertions that it recognizes. Consider that, for a two's-complement >>machine, I can assert that the TOP bit is 0 (by an range assertion I >= 0), >>but not that the BOTTOM bit is 0 (I is even - something that might be very >>nice to be able to say if I is going to be used as a word address on an 11.) >> ... >>A more general assertional system MIGHT - and would be an extraordinarily >>useful thing anyway, much more useful than any static typing system I've >>ever seen. This is not an argument against strong typing, but rather about the inadequacy of implementations of strong typing. Could Pascal not be extended so that types could include assertions about evenness/oddness, to use your example? Increasing the robustness of a strong typing mechanism seems like a fine idea. >>It requires me to tell the system things that it ought to be able to >>figure out for itself. If I is used ONLY as a loop counter, the compiler >>can easily tell that I can only take on integer values. Why should I have >>to say so? >> ... >>the "problem" being solved by most strong-typing systems - compile-time >>checking for inconsistencies - is just NOT a significant problem in real >>life. >> ... >>Hence, the declaration is redundant. My claim is that the same reasoning >>ought to be applied to other type information. In my programming experience, such checks have aided me in catching a large number of stupid bugs. Having the compiler force you to make such declarations may slightly increase your work, but once you're used to it, and if you have a reasonable programming environment and language, the amount of such work is insignificant. I would suggest that features in a language that increase the likelihood of checkable assertions in a the source code are a good thing. A strong typing mechanism certainly falls into this category. >>religeous [sic] belief that "default declarations" are bad, because PL/I >>used them and we all know that NOTHING that PL/I did was right. I will elide the question of whether PL/I did ANYTHING right, but it is the consensus of the computer scientists that I know that default declarations are bad. I done enough FORTRAN programming in my earlier days to know the grief one can go through because of a variable that is automatically declared because of a typo. Steve Vegdahl Tektronix, Inc. Beaverton, Oregon