sysop @ mousehouse:
Quick start on programming
started on 01.01.1998 - updated 01.09.1998
Index
- What is programming?
- What must a programmer do before he sits down and hacks?
- A bad example
- An example I like more
- User-interactive programs
- Miscellaneous
1. What is programming?
Programming is creating files that tell the system what to do, in a fast, reliable and effective way.
This may be the common definition, and I think it has left a world out: the world of the users.
I DO NOT enjoy to praise Micro$oft, but I must do. These folks have made the use of, say, a
wordprocessor as easy as the use of a hammer or a car.
First with bad, brain- or finger- or tin-damaging results. But with results! Results
you could view, you could touch, and you could carry away from the computer to ask others how to
improve them.
So a programmer must know about both.
- the system he is going to write a program for;
- and the users who will have to use it.
So, programming is to make the system work for the user.
In most cases, this means to hide the system away from the user as wide as possible.
It means also, that it is programmer's task to think like the system on the one hand (to make it
work) and to think like a user on the other hand ("Oh! The system says mousehouse:$ _
and beeps! What does that mean?")
Wah, I hate to write intros like these.
2. What must a programmer do before he sits down and hacks?
I guess he must switch off the computer, leave the computer room, and write these questions
(with answers) down on a piece of paper:
- What will the program do that I am going to write?
- Is this solving a mathematicel or hardware problem? Which, when and how?
- Who will use this program?
- Does this program process files, without any user's interaction?
- Does this program do anything with the user interfering? Which, when and how?
I will not talk anything about programming hardware or solving mathematical problems here, as I
usually do work on things like these.
Instead I will specify what a well-known to me user (me myself) would like to be prompted with
when using a program.
I should say at this place that most lacks do occur on most programs, so a user-intercface modul
should be no problem taking away more than 30% of programmer's time.
2.1 A bad example
tar
usage: tar [options] ... [files]
2.2 An example I like more
tar
Welcome to tar @ mousehouse: ! Choose a selection:
0 exit
1 General overview over tar (one screenful)
2 syntax hints for tar
3 options for tar
4 a quick'n'dirty EXAMPLE for tar
9 More help on this
1
General overview over tar
I the old days, we used tape machines to backup files. They used
a very simple filesystem, and all backuped files went into one huge
tar file. In a way, that they could be taken apart again, of course.
Today, we still use tar, as it has proven very reliable. But we
produce our huge *.tar files on the harddisk and compress it (with
gzip) to save disk space and data transfer time.
tar will take everything you tell it to work on, and add it to a huge
file with your favorite name.
Or process such a file and separate the tarred files in there.
0 exit
1 General overview over tar (one screenful)
2 syntax hints for tar
3 options for tar
4 a quick'n'dirty EXAMPLE for tar
9 More help on this
3
Options for tar
c zip files together
x separate files
p preserve properties
f tar / untar subdirectories
v verbosely
0 exit
1 General overview over tar (one screenful)
2 syntax hints for tar
3 options for tar
4 a quick'n'dirty EXAMPLE for tar
9 More help on this
4
tar -cpvf a* >all.a.files
glues
files and directories, recursively
with properties
verbosely
don't know what f is for
starting with an "a"
and write them to all.a.files.tar
tar -xpvf all.a*
processes every file starting with all.a
and tries to separate the glued files.
Usually, tar checks whether this is a tar archive at all.
0 exit
1 General overview over tar (one screenful)
2 syntax hints for tar
3 options for tar
4 a quick'n'dirty EXAMPLE for tar
9 More help on this
9
See man tar.
3. User-interactive programs
This thing with tar was nearly free of interaction - except that user must specifiy which files he wants
to have processed in which special way.
How much more hacking will comforting of a text-processor cost? - In fact, not much. Let us look at vi.
Worst version
~
~
~
~
~
~
~
~
~
~
Command
(Yes, this is the standard vi surface.)
"Um, so much Tildes. And what does command mean? Does this machine think it can order me?"
20 secs later: "Hm, seems system is waiting for input."
<a> BEEP <b> BEEP <c> BEEP <d> BEEP <e>
fghijklö
~
~
~
~
~
~
~
~
Input
"Doesn't work. I must get out of here.."
<ESC> <ESC> BEEP <ESC> BEEP <ESC> BEEP <ESC> BEEP
Another terminal left alone.
What could have been done?
- A more informative Status bar?
- A help screen coming up after 3 secs?
- A help system, available on, say, >F1< (and announced so on status bar, perhaps)?
- A key bindings screen, coming up 2 secs after C- has been pressed?
You see, the system needs not become worse by this. And in my opinion, this IS programmer's
work.
Especially on Un*x systems, which are so similar one to another, there should be no problem
invoking something like this.
4. Miscellaneous
Back to Linux Users Help Page . . Back
to Main Page
This page hosted by
Get your own Free Home Page