Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site talcott.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!tmb From: tmb@talcott.UUCP (Thomas M. Breuel) Newsgroups: net.lang.c Subject: Re: Re: C Programming Style -- New thought ("writing code") Message-ID: <472@talcott.UUCP> Date: Fri, 26-Jul-85 01:27:38 EDT Article-I.D.: talcott.472 Posted: Fri Jul 26 01:27:38 1985 Date-Received: Sun, 28-Jul-85 08:51:53 EDT References: <418@spar.UUCP> <408@utastro.UUCP> <153@brl-tgr.ARPA> Organization: Harvard University Lines: 43 > > General question: does anybody "write code" on paper first any more? > > Probably not many (except in DP shops that are way behind the times), > in the sense of preparing code that can then be transcribed by a > "keypunch operator". I have seen a lot of people who should know > better try to DESIGN their code while they are entering it.. Several computer scientists have come up with program design languages. They are usually derived from programming languages like ALGOL or PASCAL and (well, they can't enforce it anyway) allow a lot of syntactic and semantic freedom, but are intended to cause you to think of your problem in a structured manner. You can basically do the same thing by using your favourite programming language and mixing it with natural language, e.g.: while(there are still elements in the set) { pick an element; check for membership in exclusion set; if(not member of exclusion set) { ... There have been many attempts at enabling people to do program design at the terminal, but none of them were really successful. A programming language called 'ELAN', for example, was designed for (interactive) top-down programming by allowing you to specify your programs in a mixture of natural language and PASCAL, and then to resolve the natural language parts by macro expansion. Object oriented systems and LISP machines are other such examples of programming environments that are supportive of interactive program design. A good programming environment and a suitable language can help to make interactive program design less of a disaster; most of the time the results are pretty awful, though (look at UN*X sources -- at least I think that that's what's wrong with them). It is very tempting just to sit down and 'hack something together', in particular if you are writing in 'C' on a UN*X system, but if you really care about a program, I would recommend to sit down and think about it for a long time, start scribbling ideas on paper, and gradually try to implement this or that module. Often you still need several tries to get it right. Thomas.