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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-14 02:07:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3EEAE5C0.7080006@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X References: <6a90b886.0305262344.1d558079@posting.google.com> <3EE7CC70.E1FD3A67@adaworks.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.62.164.137 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1055581653 24.62.164.137 (Sat, 14 Jun 2003 09:07:33 GMT) NNTP-Posting-Date: Sat, 14 Jun 2003 09:07:33 GMT Organization: AT&T Broadband Date: Sat, 14 Jun 2003 09:07:33 GMT Xref: archiver1.google.com comp.lang.ada:39157 Date: 2003-06-14T09:07:33+00:00 List-Id: > A nice cure for that is forcing yourself to write a bigger project in > Perl and then try to debug it a week later to find the errors in the > code. You might even give it to somebody else and ask her/him to > introduce some bugs in your code, and then you do the debugging. You should try APL for a real write once read never language. I know of several "large" APL programming projects that had a rule that functions had no more than one line of code, and you never documented how it did anything, just what it did. Maintenance programming began by reading the comments and throwing the line of code away. As a good example of this style of programming it takes eighteen characters in APL to find all the numbers in a vector of sequential integers starting at one that can be represented in exactly two ways as the product of two integers. (In other words find all primes less than a given integer value N.) Or you can use seventeen characters if instead you find all integers that are not the product of two integers greater than one. A slightly more complex definition of primes, but easier in APL. But if you really want to be efficient in generating primes, use Wilson's Theorem. A number P is prime iff (P-1)! mod P is congruent to -1 mod P. In APL that only takes sixteen characters. ;-) No, the number of characters is not the only measure of efficiency. But if you think about the last algorithm, in a implementation with "bignum" integer support, it takes one temporary, and one multiply and one mod operation per number tested.