Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. AWK > Programming by Example

Programming by Example

You mentioned that AWK is a language that lives because of programming by example.

Peter: That was a deliberate design decision. There’s many things; some of them bad, some of them good. AWK has a collection of interesting—which is a very polite way of describing it—syntactic choices, of which I think only a couple are real mistakes. Mostly the idea was it would look a lot like C because then we wouldn’t have to explain it to the people we worked with.

Then the question is now what? Our view was that since all AWK programs would be one line or at most a few lines, the way to program AWK was to look and find examples that did something like you wanted. Just change them. If you wanted something more complicated, you’d do it incrementally and that would all work out. At the same time we were doing AWK there was a project at Xerox PARC, whose name I’ve forgotten unfortunately, which was in vaguely the same space as AWK. It was supposed to process files. The Xerox PARC systems didn’t think of their files with any lines and stuff, but it was close. They meant it to be used by secretaries. The page you wrote on was two columns. You wrote ....


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint