From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public From: Craig Burley Subject: Re: C vs. Fortran - Perl wins Date: 1997/10/09 Message-ID: X-Deja-AN: 279153247 References: <612k6f$i79@news-rocq.inria.fr> <343C3737.5435@Japan.NCR.com> <61jc3i$h2q$1@sue.cc.uregina.ca> <61jpop$6hj$1@lyra.csx.cam.ac.uk> Organization: Cygnus Support Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec nmm1@cus.cam.ac.uk (Nick Maclaren) writes: > In article <61jc3i$h2q$1@sue.cc.uregina.ca>, > John Bayko wrote: > > > > But the reason for C's popularity (theory #514) is because it was > >the first language to treat pointers conveniently. Granted, pointers > >are also the cause of a great many bugs and abuses, but they were a > >necessary step towards objects, and could be implemented efficiently > >on the computers of limited speed back then. > > In other words, C's pointers made possible complex programs using > >intricate data structures, while other languages only allowed this > >indrectly or implicitly. > > My dear sir! Oh my dear sir! While you are right that C belongs to the > class of languages that treats pointers 'conveniently', to describe it > as the first is a gross terminological inexactitude. > > Let me draw your attention (gently) to BCPL (C's grandparent) and Algol 68 > (whose name suggests a date earlier than C) and point out that these were > nowhere near the first languages to support such constructions. I don't know about John's *intent*, but I took his use of "conveniently" in a more general sense, one that might well make his statement correct. First, BCPL, as a grandparent of C, doesn't really discount his argument anyway, but... ...second, my sense is that when the "programming explosion" began to happen, when portability across a wide number of machines mattered, and when the programs were doing more iron-level things like OSes, compilers, and so on, C *was* the first *convenient* language that allowed manipulation of pointers that were, semantically, much like the underlying machines' pointers. I think that's likely to be at least one of the major reasons, if not *the* major reason, that the programmers involved in the programming explosion of the '70s and '80s tended to fall into the "well" of C. Personally, having done these kinds of programming in a variety of assembler languages, BASIC, FORTRAN, PL/I, and C, there's no question in my mind that C was the best tool for the job. I've had to fight it, sure, but nowhere near the degree to which I had to to write my code in an even-remotely-legible way (assembler and Fortran looked really bad here), fight to gain access to the underlying iron (BASIC, FORTRAN, and, *except* for pointers, even PL/I bad here), and have some assurance I wasn't magically invoking tons of unrelated code to do a trivial thing (BASIC and PL/I bad here, and now of course C++). The fight I remember going on over these issues back then was really Pascal vs. C, because Pascal was the "other" language that offered convenient access to pointers -- again, assuming "convenient" included "not vastly expensive to put a decent compiler up on a new macine", which is why PL/I, and presumably Algol variants, didn't make the grade. Pascal lost, because it didn't offer quite enough portability for the low-level things programmers of these near-iron apps tended to want to do, but not, IMO, because it was a worse language, because it (probably) wasn't. It was a worse tool for the needs of the new programming explosion, especially the one that included portability across machines (which, say, Apollo didn't have to worry about, so they probably enjoyed their choice of Pascal -- until it came time to port their software to new architectures anyway). So I think John's point is quite a good one, even though, as with almost every "de facto" standard product, the features that are claimed to make it "unique" or "a first" really weren't actually introduced by that product -- but were *seemingly* so introduced by virtue of being the first product with those things that was available and convenient to access when the need for those features began to be widely recognized. Along the same lines, the Mac didn't have the first GUI, but it seemed like it did when affordable GUIs began to be appreciated and affordable. In a sense, the Mac did for GUIs what C did for pointers and floating- point math -- made access to these things much more convenient and affordable than the other, perhaps more noble, efforts tried to or, more certainly, succeeded at doing. Similarly, if Java wins out, it won't be because it's the first, or even best, effort at a "truly portable language [with useful library baggage]", rather because it's the *right* effort at the *right* time and price point. And don't get me started about the IBM PC and Microsoft produces. ;-) Now, keep in mind that, during much of the time these issues were *really* being thrashed out, I was at Pr1me, a world unto itself, mostly, that took its architectural and linguistic cues from an entirely different base -- namely, FORTRAN, PL/I, and Multics, plus doses and dashes of other stuff here and there. C wasn't even a blip on the radar screen when the P400 architecture was conceived, especially for a vendor that cared a lot more about shipping a wide performance range of compatible machines than about writing a lot of software that'd port to alien machines. (And, in the end, that cost Pr1me dearly, I think.) So most of what I know about all this is from my attempts at figuring out "what happened!?" when I moved from Pr1me to the UNIX/Internet world over a period of years starting in the mid-'80s. Getting back to Perl, that is definitely one tool I want to learn, and pretty soon. I doubt I'll find it a Great Language, but I'm pretty sure I'll find it a decent language and a Truly Great Tool, given how many people seem to find it so already -- or I'll learn a lot more by figuring out why it doesn't quite make the grade, should that turn out to be the case (but I hope it doesn't). -- "Practice random senselessness and act kind of beautiful." James Craig Burley, Software Craftsperson burley@gnu.ai.mit.edu