Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!ubiquity From: ubiquity@cs.utexas.edu (Richard Hoffman) Newsgroups: comp.lang.misc Subject: Re: What makes a language "easy" to program in? Summary: Short code for Long Operations Message-ID: <2870@cs.utexas.edu> Date: 16 Jun 88 03:48:15 GMT References: <3496@enea.se> Organization: U. Texas CS Dept., Austin, Texas Lines: 32 In article <3496@enea.se>, sommar@enea.se (Erland Sommarskog) writes: > Richard Harter (g-rh@CCA.CCA.COM.UUCP) writes: > > As a side point, this examples illustrates a comon deficiency > >in programming languages -- they force the user to specify too much. > >What is wanted in this case is really something like > > for i in {0,...,n-1} a[i] = 0; > >or even > > a = 0; > > The ultimate winner is VAX-Pascal, though: > a := zero; > The predefined function zero can be used to clear any array or record. In APL, one has (sort of): A<-(pA)p0 (Please read "<-" as a single character, "p" as a rho, and tilt your head a little when you look at the "A"s :-) ). And the much-maligned PL/I wins with: A=0; Keystrokes: PL/I=4, APL=8; Pascal=8 (not counting spaces). But of course, in APL no previous declaration of "A" is necessary. > >The best programming language only has one instruction: > > > > "Do what I want" Please don't give a copy of the compiler of that language to the Pentagon. -- Richard Hoffman / 5751 Valkeith / Houston, TX 77096 / (713) 729-5716 +- / 12166 Metric Blvd., #122 / Austin, TX 78757 / (512) 823-1822 "Malt does more than Milton can / To justify God's ways to Man." -- ??