Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site macbeth.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxr!ulysses!allegra!princeton!astrovax!fisher!macbeth!haahr From: haahr@macbeth.UUCP (Paul Haahr) Newsgroups: net.lang.c Subject: Re: When words are good and when words are bad Message-ID: <128@macbeth.UUCP> Date: Mon, 29-Jul-85 00:35:07 EDT Article-I.D.: macbeth.128 Posted: Mon Jul 29 00:35:07 1985 Date-Received: Wed, 31-Jul-85 02:39:59 EDT References: <1985@ukma.UUCP> <2903@ncsu.UUCP> Organization: Princeton University Lines: 51 Jon Mauney (mcnc!ncsu!mauney) writes in <2903@ncsu.UUCP>: > If symbols are so great, why not do away with keywords entirely? We could > use <- for "goto", @-> for "if", >< for "while", and [->] for "switch". > Wouldn't that make programs a lot easier to read? Dijkstra et. al. use the guarded command syntax with extremely few keywords, (i.e. do od if fi proc skip...) and heavy use of symbols to produce what many people consider readable code. I do work in lisp and certainly don't find (plus a b) more readable than "a + b", or (setq a b) easier to understand than a = b or a := b. The notation of (algol|fortran)-like languages certainly parallels more closely mathematics, which is how most people are taught ideas like multiplication. Control flow is something people generally first learn in computer science, so there is really no argument saying that we should steal from some other field a better notation. Use of keywords has been around for a while, but that seems to be only because that's the way things were done way back when. Certainly the notation you suggest is (intentionally) awful, but writing -> (or => or something) makes sense. Even in Ada (tm - DoD/AJPO), the most verbose of languages (not that this is necessarily bad, just an observation) the design team made the choice of use the "when green =>" rather than "when blue do" notation. That wasn't thought to decrease readability. Besides, what are words but symbols? They just happen to be symbols made up of symbols in a specific alphabet that have a meaning some arbitrary language (in this case English) that a lot of people have at least a passing familiarity with. One could argue that fewer keywords and more symbols in a programming language would lead to a more international (at least spoken language independent) style of programming. I am not arguing that the use of symbols is inherently better. I am arguing that carefully picked out symbols can lead to readable program structures. For expressions. For control flow. And for data types (note that I find C's notation worse than Pascal's for data types, and find this the part of C I like least, but this is the specific notation used and the use of notation in general). To quote the 4.2 bsd distribution of fortune: Re graphics: A picture is worth 10K words -- but only those to describe the picture. Hardly any sets of 10K words can be adequately described with pictures. Now algorithms aren't pictures. Or words. And a combination of words and pictures together provide the description of an algorithm. I find that more symbols help describe these ideas. Obviously there are different opinions. -- Paul Haahr ..!princeton!macbeth!haahr