+ X-NEWS: spcvxb alt.folklore.computers: 5679 I Relay-Version: VMS News - V6.0 13.10.90 VAX/VMS V5.4; site spcvxb.spc.edu q Path: spcvxb.spc.edu!njin!princeton!udel!wuarchive!usc!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!lth.se!newsuser " Newsgroups: alt.folklore.computers& Subject: Re: Mel was a Real Programmer+ Message-ID: <1990Nov26.133507.21772@lth.se> 2 From: magnus%thep.lu.se@Urd.lth.se (Magnus Olsson) Date: 26 Nov 90 13:35:07 GMT1 Sender: newsuser@lth.se (LTH network news server) Q References: <1990Nov24.230549.2164@cs.umn.edu> <1990Nov25.000411.6793@cs.umn.edu> : Organization: Theoretical Physics, Lund University, Sweden Keywords: Mel, Real, Programmer 
 Lines: 281  [ In article <1990Nov25.000411.6793@cs.umn.edu> vergis@cs.umn.edu (Anastasios Vergis) writes: - >Here is the story of Mel, a Real Programmer.    (stuff deleted)   K >I first met Mel when I went to work for Royal McBee Computer Corp., a now- I >defunct subsidiary of the typewriter company.  The firm manufactured the K >LGP-30, a small, cheap (by the standards of the day) drum-memory computer, K >and had just started to manufacture the RPC-4000, a much-improved, bigger, L >better, faster drum-memory computer.  Cores cost too much, and weren't hereH >to stay, anyway.  (That's why you haven't heard of the company, or the  >computer.)     K Yeah, but that's the mutilated version - the one some *(&%^**%# person with N a neatness complex but no sense for poetry has run through a text formatter...? [No real offence intended - just blosing off some steam... :-)]   J The original text is in free verse. That adds a dimension to it - it feels' like some great heroic epic, sort of...   N Also, the first few stanzas are missing in the "prose" version. So, for anyoneL on the net who hasn't seen it yet (unbelievable as it may seem), here it is,+ the *real* epic of Mel (below my signature)   - Magnus Olsson                   | \e+      /_ - Dept. of Theoretical Physics    |  \  Z   / q 5 University of Lund, Sweden      |   >----<            2 Internet: magnus@thep.lu.se     |  /      \===== g- Bitnet: THEPMO@SELDC52          | /e-      \q         @      A recent article devoted to the *macho* side of programming-      made the bald and unvarnished statement:   2                 Real Programmers write in Fortran.        Maybe they do now,       in this decadent era of=      Lite beer, hand calculators and "user-friendly" software #      but back in the Good Old Days, +      when the term "software" sounded funny @      and Real Computers were made out of drums and vacuum tubes,,      Real Programmers wrote in machine code.;      Not Fortran. Not RATFOR. Not, even, assembly language.       Machine Code.5      Raw, unadorned, inscrutable hexadecimal numbers.       Directly.  /      Lest a whole new generation of programmers 0      grow up in ignorance of this glorious past,#      I feel duty-bound to describe, .      as best I can through the generation gap,&      how a Real Programmer wrote code.      I'll call him Mel,       because that was his name.   H      I first met Mel when I went to work for Royal McBee Computer Corp.,8      a now-defunct subsidiary of the typewriter company.&      The firm manufactured the LGP-30,1      a small, cheap (by the standards of the day)       drum-memory computer,(      and had just started to manufacture#      the RPC-4000, a much-improved, 4      bigger, better, faster -- drum-memory computer.      Cores cost too much, &      and weren't here to stay, anyway.D      (That's why you haven't heard of the company, or the computer.)  1      I had been hired to write a Fortran compiler =      for this new marvel and Mel was my guide to its wonders. %      Mel didn't approve of compilers.   /      "If a program can't rewrite its own code," !      he asked, "what good is it?"         Mel had written,       in hexadecimal,9      the most popular computer program the company owned.       It ran on the LGP-30 2      and played blackjack with potential customers      at computer shows. $      Its effect was always dramatic./      The LGP-30 booth was packed at every show, &      and the IBM salesmen stood around      talking to each other. 0      Whether or not this actually sold computers'      was a question we never discussed.         Mel's job was to re-write,      the blackjack program for the RPC-4000."      (Port?  What does that mean?)(      The new computer had a one-plus-one      addressing scheme, '      in which each machine instruction, &      in addition to the operation code+      and the address of the needed operand, F      had a second address that indicated where, on the revolving drum,&      the next instruction was located.      In modern parlance,6      every single instruction was followed by a GO TO!.      Put *that* in Pascal's pipe and smoke it.        Mel loved the RPC-4000 (      because he could optimize his code:-      that is, locate instructions on the drum *      so that just as one finished its job,7      the next would be just arriving at the "read head" +      and available for immediate execution. (      There was a program to do that job,      an "optimizing assembler",       but Mel refused to use it.   4      "You never know where its going to put things",=      he explained, "so you'd have to use separate constants".   8      It was a long time before I understood that remark.'      Since Mel knew the numerical value       of every operation code, )      and assigned his own drum addresses, 8      every instruction he wrote could also be considered      a numerical constant.8      He could pick up an earlier "add" instruction, say,      and multiply by it,'      if it had the right numeric value. 6      His code was not easy for someone else to modify.  -      I compared Mel's hand-optimized programs E      with the same code massaged by the optimizing assembler program, !      and Mel's always ran faster. =      That was because the "top-down" method of program design       hadn't been invented yet,*      and Mel wouldn't have used it anyway.=      He wrote the innermost parts of his program loops first, #      so they would get first choice 2      of the optimum address locations on the drum.D      The optimizing assembler wasn't smart enough to do it that way.  .      Mel never wrote time-delay loops, either,$      even when the balky Flexowriter>      required a delay between output characters to work right.-      He just located instructions on the drum 9      so each successive one was just *past* the read head       when it was needed;8      the drum had to execute another complete revolution"      to find the next instruction.8      He coined an unforgettable term for this procedure.,      Although "optimum" is an absolute term,4      like "unique", it became common verbal practice      to make it relative: *      "not quite optimum" or "less optimum"      or "not very optimum". 0      Mel called the maximum time-delay locations      the "most pessimum".   ,      After he finished the blackjack program      and got it to run, *      ("Even the initializer is optimized",      he said proudly) 7      he got a Change Request from the sales department. ,      The program used an elegant (optimized)      random number generator5      to shuffle the "cards" and deal from the "deck", 3      and some of the salesmen felt it was too fair, (      since sometimes the customers lost.*      They wanted Mel to modify the program9      so, at the setting of a sense switch on the console, 9      they could change the odds and let the customer win.         Mel balked.)      He felt this was patently dishonest,       which it was,D      and that it impinged on his personal integrity as a programmer,      which it did,      so he refused to do it.%      The Head Salesman talked to Mel, 3      as did the Big Boss and, at the boss's urging,       a few Fellow Programmers.,      Mel finally gave in and wrote the code,#      but he got the test backwards, .      and, when the sense switch was turned on,1      the program would cheat, winning every time. !      Mel was delighted with this, :      claiming his subconscious was uncontrollably ethical,%      and adamantly refused to fix it.   9      After Mel had left the company for greener pa$ture$,o.      the Big Boss asked me to look at the code5      and see if I could find the test and reverse it.o,      Somewhat reluctantly, I agreed to look..      Tracking Mel's code was a real adventure.  7      I have often felt that programming is an art form,a-      whose real value can only be appreciatedh.      by another versed in the same arcane art;.      there are lovely gems and brilliant coups>      hidden from human view and admiration, sometimes forever,'      by the very nature of the process.r,      You can learn a lot about an individual&      just by reading through his code,      even in hexadecimal. (      Mel was, I think, an unsung genius.  #      Perhaps my greatest shock camem:      when I found an innocent loop that had no test in it.      No test. *None*.i2      Common sense said it had to be a closed loop,8      where the program would circle, forever, endlessly.6      Program control passed right through it, however,#      and safely out the other side.d+      It took me two weeks to figure it out.t  7      The RPC-4000 computer had a really modern facilityy      called an index register.6      It allowed the programmer to write a program loop-      that used an indexed instruction inside;*      each time through,e%      the number in the index registerr2      was added to the address of that instruction,      so it would refer#      to the next datum in a series.t0      He had only to increment the index register      each time through.a      Mel never used it.   D      Instead, he would pull the instruction into a machine register,      add one to its address,      and store it back.a3      He would then execute the modified instructionM      right from the register.n;      The loop was written so this additional execution timec      was taken into account --'      just as this instruction finished, 7      the next one was right under the drum's read head,=      ready to go.O$      But the loop had no test in it.  '      The vital clue came when I noticeda      the index register bit,)      the bit that lay between the address 4      and the operation code in the instruction word,      was turned on--+      yet Mel never used the index register, "      leaving it zero all the time.1      When the light went on it nearly blinded me.s  .      He had located the data he was working on      near the top of memory --<      the largest locations the instructions could address --*      so, after the last datum was handled,)      incrementing the instruction addressc      would make it overflow.#      The carry would add one to the H      operation code, changing it to the next one in the instruction set:      a jump instruction.2      Sure enough, the next program instruction was      in address location zero,-      and the program went happily on its way.w  &      I haven't kept in touch with Mel,7      so I don't know if he ever gave in to the flood of 7      change that has washed over programming techniquesw       since those long-gone days.      I like to think he didn't.a      In any event,7      I was impressed enough that I quit looking for thed      offending test,-      telling the Big Boss I couldn't find it.t      He didn't seem surprised.        When I left the company,u,      the blackjack program would still cheat-      if you turned on the right sense switch,()      and I think that's how it should be.,      I didn't feel comfortable/      hacking up the code of a Real Programmer."r    9          -- Source: usenet: utastro!nather, May 21, 1983.l