home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / docs / blazehumor-1.0.lha / BlazeHumor-1.0 / Articles / weirdbench.7 < prev   
Text File  |  1993-09-01  |  5KB  |  92 lines

  1.                 WEIRDBENCH
  2.                            Programming Explained
  3.                               September 1993
  4.  
  5.                      Copyright 1993 Daniel J. Barrett
  6.  
  7.     As you sit spellbound in your chair, zooming through the latest
  8. 16-way hyper-parallax-scrolling arcade game extravaganza, do you ever
  9. wonder how the heck Amiga programmers make all this stuff happen?  How do
  10. they create and control the zillions of graphic thingies on the screen? Why
  11. does the little guy move when you push the joystick?  And how does an A500
  12. with only 4096 colors manage such spectacular-looking crashes?
  13.  
  14.     Well, wonder no more!  This month, WeirdBench explains it all to
  15. you. It's very simple and doesn't require any programming background.  In
  16. fact, if you DO have a programming background, you probably will not
  17. understand this article at all.
  18.  
  19.     To begin, it's important to realize why programming seems like
  20. "magic" to the uninitiated.  The reason is simple:  it IS magic.  One day
  21. when you are feeling brave, open up your Amiga and find the panel that
  22. reads, "WARNING:  NO USER-SERVICEABLE PARTS INSIDE.  DO NOT REMOVE UNLESS
  23. YOU WANT TO VOID YOUR WARRANTY AND LOSE SOME LIMBS."  Behind the panel, you
  24. will find voodoo dolls, newt eyes, several scrolls and potions, and an
  25. engineer's half-eaten peanut butter sandwich sprinkled with whiffle dust.
  26.  
  27.     But on the technical side, creating a program requires that you
  28. know a programming language.  This is a language for writing commands to
  29. tell the computer what to do.  Unlike human languages, programming
  30. languages are rarely spoken aloud, or at least not in polite company. Some
  31. of the more popular ones are called BASIC, "C", Pastel, FORSKIN, Kobold,
  32. and Lithp.  Most Amiga programs are written in C, a language invented at
  33. AT&T/Bell Laboratories in the 1970's and widely praised by programmers as
  34. being "easy to spell."  Some people complain that C code is difficult to
  35. read, but they are clearly wrong, as illustrated by the following simple
  36. example:
  37.  
  38.         while (((x<y?z:snorf),c=getchar())!=NULL)
  39.             KaBoom();
  40.  
  41. Game gurus out there will no doubt recognize this as the entrance to Level
  42. 129 ("Exploding Gopher Heads") in BLAZEMONGER.
  43.  
  44.     Other programs -- notably arcade games and nuclear missile
  45. launching software (be careful never to confuse the two) -- are written
  46. directly in assembly language.  Assembly programmers love the language
  47. because it is very "low-level" and allows exact control over every aspect
  48. of the program.  The assembly equivalent of the C code above look like:
  49.  
  50.         MOVE    R1, R2
  51.         JUMP    L5
  52.         FIRE    2, Late
  53.         DIE    N, Agony
  54.         RIP
  55.  
  56. Programmers are forever arguing amongst themselves whether it's better to
  57. write programs in C or assembly.  (Those wacky programmers! They REALLY
  58. know how to have a good time.)
  59.  
  60.     Once you have chosen a programming language, you need a compiler or
  61. assembler.  These are software tools that translate your easy-to-read
  62. program into mysterious zeroes and ones that only a computer can understand.
  63. Well... that's not entirely true, because there ARE human beings who can
  64. actually comprehend machine code; but they tend to be space aliens, swapped
  65. for human babies while their parents were out at the local User's Group
  66. meeting.  But for those of us with lives, a compiler/assembler is the way
  67. to go.
  68.  
  69.     At this point, all you need to do is invent a program, write it,
  70. compile it, toss in a newt eye or two, and you're done!  Don't let those
  71. pseudo-elite hackers fool you:  creating a program is actually quite
  72. trivial, and it always works the first time.  All this talk of "bugs"
  73. and "upgrades" is just a diversion so the programmers can squeeze more
  74. money out of unsuspecting users and spend it on so-called "Developers'
  75. Conferences" which are held on tropical islands and are, in truth, nothing
  76. more than lavish, month-long orgies.  Now you know why computer programmers
  77. always have those glassy-eyed stares.
  78.  
  79.     Nowadays, programming has become even easier, thanks to advances
  80. like Commodore's AmigaVision.  Just about anybody with a mouse and an index
  81. finger can create full-fledged multimedia extravaganzas these days without
  82. the need for any specialized knowledge, or even brain cells.  The radical,
  83. die-hard programmers will claim that this isn't "true" programming, but
  84. they're just afraid that "riff raff" like you and I will start attending
  85. their private "Developers' Conferences" and there won't be enough bungie
  86. cords to go around.
  87.  
  88.     So now you're ready to get out there and start programming!  Pretty
  89. soon, you'll be creating those same astounding graphic pyrotechnics that
  90. you've seen in your favorite games and word processors.  Don't forget your
  91. voodoo doll.
  92.