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