Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!merk!xylogics!world!bzs From: bzs@world.std.com (Barry Shein) Newsgroups: alt.religion.computers Subject: Re: Shoulds arrays start at zero or one? Message-ID: <1990Jan19.025020.14568@world.std.com> Date: 19 Jan 90 02:50:20 GMT References: <4832@crdgw1.crd.ge.com> <1990Jan18.034728.8696@world.std.com> <4839@crdgw1.crd.ge.com> Distribution: na Organization: The World @ Software Tool & Die Lines: 98 In-Reply-To: shane@underdog.crd.ge.com's message of 18 Jan 90 15:58:31 GMT From: shane@underdog.crd.ge.com (Randall H. Shane) > Y'know, there is a place for a good teaching procedural language -- >one with a reasonable standard functionality like C with its standard >libraries, but with a simpler syntax, less direct exposure to the assembly >language level, and less opportunity for students to slice themselves. >Like Pascal should have been, I guess. Actually, I disagree. First, I've taught programming at various levels for about a decade. I've taught courses using, lessee, C, Pascal, PL/I and IBM/370 Assembler and even "If It's Tuesday This Must Be Cobol" (i.e. Survey Of Programming Languages, add Lisp, Snobol, Cobol, Algol, Fortran and a few others to the above list, fun course.) I don't think it's a good idea to teach in a "teaching language", far better to think hard and subset a "real" language. When I taught C people would always say "ugh, how do you get them past all that complicated pointer syntax?! What an awful language to teach in!" Well, the answer was of course I simply didn't cover pointers until they were ready to learn pointers. I also never had as much trouble with teaching pointers as some of my colleagues seemed to. I suspect this was at least partially due to the fact that I understood them and had put a lot of thought into how to explain them. I usually started with some amusing "confusion between the thing and the thing contained" stories, like when in the news they report that "The White House said today..." they don't mean The White House at all because it cannot talk, they mean the contents of the white house. Most of the problems people have with pointers has a lot to do with that sort of sloppiness in our natural languages (not that it's a problem in natural languages, context saves the day there, but we are accustomed to using a location to describe its contents as if they were interchangeable.) But I digress. Pascal was initially designed to be a teaching language and it shows. One of the design goals of the language was merely to be able to write a one-pass compiler so students wouldn't use so much CPU time recompiling, back in a day when compiling was a very dear activity. It's amusing to think that one can design a language that is both lightweight on the CPU and easy to learn. Those goals seem terribly at odds to say the least! BASIC suffers from the same problem (C doesn't only because no one ever claimed it was particularly easy to learn, it just is because it's a rather clean design, not because that was the motivation of the designer especially.) The whole idea of packed data comes from the odd word size and word-addressibility of the B6600 Pascal was first designed for. I am forever amused at the explanations students have been given for this feature (umm, it's, uh, well, packed, lessee, ah!, more memory efficient! yeah, must be that...hah! Well, true on some ancient machines, but not usually the machine being used.) The lack of external linkage in the standard language is truly quaint and heralds from an era when linking several source modules on most operating systems was a heroic feat (hence, no one needed that for teaching.) Ever notice that in order to attain portability Knuth's TeX (which is written in Web which is translated to Pascal) produces one 10,000+ line source file? Not exactly my idea of software engineering. Unfortunately, so many people were taught Pascal (particularly around engineering schools who felt they had to move away from Fortran even by the late 70's) that a market developed for letting them continue to program in Pascal in their professional careers. Since these students had grown up now and Pascal was clearly inadequate to do much anything the vendors responded by extending Pascal in an effort to capture market. So Pascal mutated into at least 50 different dialects, probably more, each usually quite incompatible. Adding a syntax for variable-length string types is not minor surgery! It was all a mistake and most so-called proponents are usually victims of that mistake trying to rationalize the situation they are in. I haven't met too many folks, who know several languages well, and consider Pascal very good. It's passable for little projects, perhaps less than 1,000 lines of code, but utterly unmanageable beyond that and truly awful for any projects that require significant interface to system libraries (again, in its standard form, once you extend it then the word "Pascal" is merely a marketing tool, if the FDA were in charge of programming languages they'd forbid those languages from being called "Pascal", "Pascal-like" perhaps.) -- -Barry Shein Software Tool & Die | {xylogics,uunet}!world!bzs | bzs@world.std.com Purveyors to the Trade | Voice: 617-739-0202 | Login: 617-739-WRLD