textfiles/humor/COMPUTER/basiczen.txt

374 lines
21 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

±±±±±±±±±Ü ±±±±±±±±Ü ±±±±±±±±Ü ±±±±Ü ±±±±±±±±Ü ±±±±±±±±Ü
±±Ûßßß±±Û ±±Ûßßß±±Û ±±Ûßßß±±Û ±±Ûß ±±Ûßßß±±Û ±±Ûßßß±±Û
±±Û ±±Û ±±Û ±±Û ±±Û ßß ±±Û ±±Û ßß ±±Û ±±Û
±±±±±±±Ûß ±±±±±±±±Û ±±±±±±±±Ü ±±Û ±±Û ±±±±±±±±Û
±±Ûßßß±±Û ±±Ûßßß±±Û ßßßß±±Û ±±Û ±±Û ±±Ûßßß±±Û
±±Û ±±Û ±±Û ±±Û ±±Ü ±±Û ±±Û ±±Û ±±Ü ±±Û ±±Û
±±±±±±±±±Û ±±±±Û ±±±±Û ±±±±±±±±Û ±±±±Û ±±±±±±±±Û ±±±±Û ±±±±Û
ßßßßßßßßß ßßßß ßßßß ßßßßßßßß ßßßß ßßßßßßßß ßßßß ßßßß
±±±±±±Ü ±±±±±±Ü ±±±±±Ü±±Ü
ßß±±Ûß ±±Ûßßßß ±±Û±±Û±±Û
±±Ûß ±±±±Ü ±±Û±±Û±±Û
±±Ûß ±±Ûßß ±±Û±±Û±±Û
±±±±±±Ü ±±±±±±Ü ±±Û±±±±±Û
ßßßßßß ßßßßßß ßß ßßßßß
***** O R *****
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ R E A L M E N P R O G R A M I N " C " ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
by
John Richard De Palma
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Red haired Sandra is the manager of the local Egghead
Software store. Gazing at her collection of software I said,
"Hi Sandra, Uh... can you show me what books and software you
have on learning to program in BASIC?"
"No, no...NOOOO... John, you want this!" Sandra said, as she
thrust an orange 10 pound box of manuals and disks into my arms.
She gave me a beaming smile.
She went on, "I studied Pascal and "C" in college for TWO
years, no one, and I mean no one studies BASIC anymore, it's a
dead programming language." She laughed, "Just as dead as
learning Latin."
"Well, Ah, hmmm...," I shifted my feet for better support
and put down Borland's version of Turbo Pascal with a small
grunt, "I studied Latin for two years, and it's not all that
dead,". "You see, Latin teaches you to know intuitively many
English prefixes, suffixes and many of the Romance language
verbs and nouns...." my voice trailed off, even to me that
sounded like an apology for spending two years learning about
BIG Julie (aka Julius Caesar) and wars fought with catapults
and giant slingshots.
"Oh, don't be SILLY," Sandra said, "Here, if you don't like
that, buy this, its C ++ with OOP."
"I'm not even going to ask what "OOP" is, I said, just sell
me something in BASIC," I sighed.
"What KIND of basic programming do you want?" Sandra asked
briskly, swiveling around to check on her employees and
motioning to Brian to stop playing with the joystick and get back
to work.
"Well, hell, I DON'T KNOW, I just want to learn how to make
my own programs like Paul Somerson does. If BASIC is good enough
for him, it's good enough for me," my voice rising a half-octave.
I started looking around for the IBM utilities section in the
hopes of finding some box with basic BASIC information on it.
There was no question that I knew NOTHING about programming.
I was awkward and out of my depth. I knew nothing about
programming except that it had to be better than using batch
files to do things with MS-DOS. I was going to tell Sandra about
batch files. Tell her about all the batch file programs that I
had looked at that promised much and delivered little. I wanted
to tell her about batch techniques that did not allow input into
them except as parameters on the command line or by using the
dopey "FOR" command or the klutzy "IF ERRORLEVEL" command. I
wanted to tell her I wanted to make colorful screens with
selections that could be input by cursor control. I wanted to be
able to change directories, do file sorts... I wanted to
understand how the computer worked and then tell it what to do.
Hell and again hell, I wanted to control the computer software.
Who's Paul Somerson?" Sandra queried. "Some computer
propeller head in Santa Monica?"
"Gad, Sandy, give me a break! Paul Somerson is the editor
of my favorite PC bible, "DOS Power Tools," he programs in BASIC.
Look...look, you have his book on your bookshelf right here.
Wait... waaait, I'll find the section and read it to you. Come
back here, Oh let Brian wait on that guy, this will only take a
minute."
I picked up the book, found the page and read from my hero
Paul[1],
"One of the nicest things about BASIC is that if you
suddenly find yourself with a problem BASIC can tackle, you can
load it, stumble your way through a program and emerge with a
solution a few minutes later. So maybe your program wasn't the
most elegant display of programming virtuosity; who cares as long
as it worked?"
Sandra went on, "Well shoot yourself...I mean suit yourself,
heh, heh, a little joke there. BASIC is dumb and slow. Learn
"C" or Pascal, I did when I went to UCLA. No one teaches that
dumb stuff." Sandra was very convincing and convinced.
Backed into a corner and now defending both Latin, a dead
language and BASIC a dead programming language I asked, "Well, if
that's true, let me ask you a couple of questions. Do you use a
computer...? You do. Do you use a computer to do applications,
spreadsheets and mathematics...? You do. Do you use ANY of the
Pascal and "C" you learned to help you to doing things with these
programs. You don't..? Why?"
Sandra went on to tell me how hard it was to keep up these
great skills she learned in college and that she really didn't
have the time to program, or the interest. She freely admitted
that though she studied programming for two years, she never used
it outside of class. She glanced at the clock, at the three
people questioning Brian all at the same time and gave me a book
called "Learn BASIC Now." She said as she walked away, "BASIC,
is too dumb, it's a wimpy language. You're wasting your time,
you'll be sorry. It's really not even a HIGH language."
Apparently I bought a peasant computer language of limited
capacity for limited minds. If I wanted to be part of the
intelligentsia, I should program in "C". At least in "C" if not
in C ++ with OOP or in Pascal. So I went home, loaded the
software and wrote my first BASIC program with Microsoft's Quick
Basic 4.5 Interpreter. The program was one line of text which
printed to the screen. Big deal, I want power and I get a batch
file look alike.
If I couldn't learn BASIC how could I learn these more
elitist and complicated computer languages? I needed some
verification and clarification. I began asking my friends about
computer programming.
Harry said, "Gosh John, I learned FORTRAN and COBOL when I
was 17, wrote flocks of programs in them, nope don't know BASIC,
it's too dumb and slow. What's that...do I ever USE FORTRAN and
COBOL? No, not in years. What good was learning it then? What
the !@#$%*!, kind of question is that!"
Harry is always a little sensitive if you imply that he
might be bragging. Harry is a card carrying elitist, he wouldn't
be caught dead using such a peasant computer language as BASIC.
Ray is different. Ray owns his own manufacturing company
and has three Phd.s', a law degree, and went to medical school
for three years. "Of course I can program in BASIC, John, don't
be silly, that's child's play. But don't get too technical, it's
been several years now, Hee Hee..., Ray chuckled.
"Well Ray, that's great, I'm having a dickens of a time, I
didn't realize that there was BASIC, BASICA, GWBASIC, PDB, and
QUICK BASIC. What do all of these names mean and which BASIC
should I learn?" I asked naively.
Ray sputtered a fine spray just as he was tasting the wine.
He ordered another bottle of Petite Sirah; and we were able to
finish dinner with that question hanging like still smoke in the
air.
So it went on, if they did program "in the higher languages"
of C, C +, Pascal they couldn't tell what and how they did the
programming.
"Well John why do you REALLY want to learn to program for,
comm' on, tell me....comm' on...tell the truth," Marvin asked.
Marvin programs in "C" and does programs in artificial
intelligence and makes jokes about "the artificial
intelligentsia."
In desperation, I asked Marvin to write me a program that
could be an all purpose tool, sort of a Swiss Army knife that
would put up menus, take direct input from the keyboard, let you
pick your colors, be user friendly, be modifiable, you know like
software should be. Marvin said that I didn't really know what I
wanted or, I wanted too much. Besides nobody programs in BASIC.
So I went home and dragged out QUICK BASIC again and tried
halfheartedly to learn something that no one knew about from
books written by REAL "propeller heads." I read and reread the
texts trying to UNDERSTAND what the writer was driving at.
Unfortunately BASIC is mainly written by programmers who can
write code but who can't write to communicate with humans.
It was a sort of Zen, reading and not understanding. It was
a sort of chant. Reading again and again such stuff as: "DATE$
Statement sets the current date," and "DATE$ Function returns a
string containing the current date," and "FUNCTION Statement
Declares the name, parameters, and the code that form the body of
a FUNCTION procedure.[2]" Well that is as clear as Zen, and like
Zen you have to have a FEEL for the terms. As any Zen master
will tell you once you have the answer to the question, you DON'T
have the answer.
QUICK BASIC is Zen, a doing without knowing. But I
followed the instructions ---cook book style--- and a program
could be made to do something. The sound of one hand clapping
makes sense now. Trying to understand what is the meaning of the
phrase, "What is the sound of one hand clapping?" is no more
difficult than trying to understand books written by programmers.
I would have given up too, except I was given a QUICK BASIC
program that did something that I needed to have done. Pete
programs in QUICK BASIC. Pete is probably the only person I know
that REALLY programs anything for himself and he uses QUICK
BASIC. We have a mutual interest and problem with some data
collection and analysis. Pete had an answer to the problem and
he had a real program that would give an answer all written in
QUICK BASIC.
"Now Pete, I WON'T steal this program. Also, I won't sell
this program and make a million dollars on it (Well... at least
not without giving you HALF). Yes, I promise, yes that's right,
cross my heart and hope to die. And I won't give it to the
Iraqis! Now will you please...please....PLEASE give me a copy to
take home?"
After whining and pleading that I would not sell his first
born program into slavery or copyright it, he gave me a copy.
That is another Zen portion of programming, you have to earn the
knowledge yourself, no one can do it for you. Only with
programmers it's worse than Zen, they won't give you a copy of
what they know! I watched him pull up the file, run it through
his compiler and give me code that would run by its self. It was
like watching someone start a fire by using an ancient ritual, by
using a bow and a stick. It was the dawn of civilization, the
passing of knowledge, the starting of fire by friction. I was
given a real stand-alone executable program written by a real
person, Wow! After more whining he capitulated completely and
gave me the SECOND file, the QUICK BASIC code file.
I put the diskette in my shirt pocket, it was too important
to place it anywhere's else. That night I ran it inside of my
QUICK BASIC compiler. Gadsooks! it worked! The damn thing
calculated and printed the results out lightening fast and it was
information that I could really use.
Zen, part two, you can't learn something you have no use
for. That's what Sandra, Harry, Ray and all the others were
talking about. They wrote programs in class on problems that
they were given, not on problems they wanted solutions for
themselves. That's why learning programming is like Zen, it is
meaningless unless you have some use for the knowledge (which is
both very much like and UNLIKE Zen).
Good ole Paul Somerson was right. First, you need a project
that you really...really want to do. Then use the books to look
up the procedures to do the project with. Just learning all 190
QUICK BASIC commands won't cut it. You have to use it ...or lose
it!
I went back to Egghead Software; Sandra and Brian had moved
on. Scott and Lance programmed in Pascal. I asked them if there
was anything new in QUICK BASIC that was fun. Lance gave me
Microsoft's GAMESHOP. It came with the same book that I already
had, but the software contained 6 games which could be run inside
of QUICK BASIC, the code could be examined. With much head
scratching and replaying you could actually figure out how the
programmers did what they did. Again, like Zen you must
persevere, be tested, try and fail, try and fail, knowledge
doesn't come easily. But everyone likes to play games, so it
wasn't all Zen.
That was a month ago, and though it is still slow going, I
am making progress. Pete and GAMESHOP gave me hope. I have
uploaded two programs to CompuServe as shareware. The first
program has attracted two dozen downloads in two weeks. Not
great, but a start and this is also Zen; you work and study long
for small (or no) rewards. I guess some modem users downloaded
the program because it was simple, colorful, and played a song.
Nothing grand, just a program called BIRTHDAY.ZIP that puts up
colored boxes on the screen, accepts user input, and plays "Happy
Birthday" if the computer clock reads the same day and month as
the ones you type in. If it's not your birthday, it flashes
different colors and plays "Happy Unbirthday."
Some one laughed when I played the program for them and
jokingly asked to see it display the EXACT age of anyone whose
birthday was not the day it was run. He also wanted something
that would distinguish if the person inputting the data was young
or old (over or under 21).
That was beyond my ability, but then I found, if you looked
hard enough, someone had already done some of these things in
QUICK BASIC or BASICA. I found a Julian (named after Big Julie
no less) calendar function which does just that, and added it to
the program. After struggling to add that formula, it was easy
to figure out a "LOOP" that would change a phrase depending on
what the person's age was. Though the latter was simple math, it
had been years since I had been forced to do any thinking about
mathematics. Zen and math have a lot in common, but that is
another story.
With a program that calculated the person's exact age, every
young woman that played the program exclaimed "<Gasp>, that's
wrong I am NOT 29.078345 years old!" if that was her exact age.
I now warn women over 30 that this might be a traumatic event as
the computer will calculate their exact age, but they sail
blithely ahead, not believing that it will happen. All in all, a
lot of fun and some insight into human nature.
The second program, FOR-LISA.ZIP uses random number formulas
to generate screen colors, changes the screen to 40 characters
wide, and displays more ASCII graphics. This one plays a
Beethoven sonata and takes advantage of some great 1982 music
programming in BASICA that I found on a BBS. Again, I generated
simple mathematical formulas to do the work of many lines of
code. Another secret of programming which could only be
uncovered by doing. Zen is doing and not doing.
So, nothing sensational, but now my batch files are getting
a once over with this new knowledge. Now I realize that the
macros in Microsoft Word, WordPerfect, and the script in ProComm
Plus are written in BASIC. Now these macro formulas make sense!
There has been a mystic clarification of macros, again like Zen
what you learn affects other areas of knowledge.
I am thinking of ordering from Crescent Software[3] a QUICK
BASIC package that allows you to program mice, windows,
accounting, and databases. Now I have hope, and that also is
Zen. Yeah, nothing sensational unless you thought that BASICA
was another name for Zen and that "Real Men only program in C."
ÉÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍ»
º º º REFERENCES º º º
ÈÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍͼ
(1) Somerson, Paul, PC Magazine Power Tools 2nd Edition,
Bantam Books, 1990 June;1157.
(2) Microsoft, Programming in QuickBASIC Version 4.5,
1988;270-1.
(3) Crescent Software, Inc; 32 Seventy Acres, West Redding,
Connecticut 06896; VOICE: 203-846-2500.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ÃÄÄÄÄÄÄÄÄÄÄÄ ³ THE AUTHOR ³ ÄÄÄÄÄÄÄÄÄÄÄÄ´
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
The author, John Richard De Palma is a California
physician who practices adult internal-medicine and
nephrology (kidney diseases and treatment of kidney disease
by the artificial kidney). He is the CEO of a health-care
company based in Glendale, California called Hemodialysis,
Inc. Though he is old enough to know better, he has decided
to study computers; including the art and science of
programming. All the conversations and facts in his articles
are true, only the identities and locations have been
changed to protect the unknowing and innocent who talk
to him.
He has written over 130 research papers and editorials
in the field of medicine and nephrology. He continues
to write and is the "Contemporary Issues Editor" of the
magazine CONTEMPORARY DIALYSIS & TRANSPLANTATION. All
comments and opinions are his own and reflect his own
experiences and thinking processes.
He would welcome any thoughts, comments, criticisms,
spelling corrections, or QUICK BASIC code that is under-
standable by an ordinary mortal. He looks forward to
receiving any kind of reader's mail. He can be reached by
dialing CompuServe's E-Mail service and leaving a message
there for him. His CompuServe number is: 76076,571.