Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uwm.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!s41.csrd.uiuc.edu!eijkhout From: eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) Newsgroups: comp.text.tex Subject: Re: Why use TeX if ... Keywords: TeX, PostScript, typesetting, page description, programming Message-ID: <1991May13.214453.17318@csrd.uiuc.edu> Date: 13 May 91 21:44:53 GMT References: <1991May9.204113.17636@beaver.cs.washington.edu> <1991May10.065219.23433@agate.berkeley.edu> <1991May10.211802.4344@csrd.uiuc.edu> <1991May11.013248.16286@nntp-server.caltech.edu> Sender: news@csrd.uiuc.edu (news) Organization: UIUC Center for Supercomputing Research and Development Lines: 46 marcel@cs.caltech.edu (Marcel van der Goot) writes: >[ NOTE: This is quite a long posting --- sorry for that. There is a > summary at the end. >] No need to apologise, your observations are interesting enough. >Also, the history of programming shows you wrong: ``hacking'' (used >in the negative sense) occurs in all programming languages. The hacking >problem is caused by programmers who lack knowledge about programming >techniques. But writing inscrutable code (which is what I think the original posters really meant to say) is easier in TeX (as it is in APL) than in Pascal or other more run-of-the-mill programming languages. >TeX is indeed based on macro substitution, rather than on the constructs >found in conventional programming languages. But then, TeX is not a >general-purpose programming language, it is specifically designed for >typesetting text. There is one observation that so far no one has made on this forum, maybe because it's so trivial, maybe not. That is: TeX is based on a model of simple, incremental, one-pass scanning of a piece of text. There is no 'goto' statement in TeX. A macro is not a piece of program code: it is a side-tracked piece of input. Therefore recursive incorporation of a macro replacement text in the incrementally absorbed input is the only form of iteration imaginable. Hence no loop constructs. Large parts of the design of TeX follow immediately from this basic principle. > Marcel van der Goot Victor Eijkhout > .---------------------------------------------------------------- > | Blauw de viooltjes, marcel@vlsi.cs.caltech.edu > | Rood zijn de rozen; > | Een rijm kan gezet > | Met plaksel en dozen. > | Gesproken als een ware zoon van het land van vadertje Cats.