Post Edit Home Help

Key Pages

Projects

Changes [Nov 25, 2009]

Working environment
Contents
Related work
Help
Comparison to other...
Historical notes
Larry Virden
   More Changes...
Changes [Nov 25, 2009]: Working environment, Contents, Related work, Help, ... MORE

Find Pages

Appendix. Historical notes

[From end chapter 2]

What does stdin mean?

I have not explained, as yet, what "stdin" is all about. That is actually a long story that I will explain briefly. Computers nowadays have a graphical screen and a keyboard, a mouse and possibly a scanner, a joystick and what not. In the "old" days, computers had a keyboard and a screen only (mostly used to display text). Some even older computers used a long sheet of paper instead of a screen as you know it. And I won't explain the concept of punch cards (or tapes, or patch cords, ...) here.

The wide variety of "output" and "input" devices meant some common terminology was required: stdin stands for standard input and there are two other common device names, stdout for standard output and stderr for standard error. These can be thought of as:

Nowadays, you might expect other "standard" facilities too, like reading the position of the mouse, but I have never seen anything of the kind.

(Additional notes: famous games or apps like Eliza and Game of Life, the ping pong game)

Euclid's Algorithm

For centuries the word "algorithm" was used only for the method described by the Greek mathematician Euclid to find the greatest common divisor:

The greatest common divisor of the numbers n and m can be found in the following way:

It is an almost trivial exercise to turn this into a little program.

ELIZA

The original ELIZA program used a while bunch of tricks to decide what the most important words were. It also knew hot to construct new sentences from pieces the user typed. Like:

User: I hate my father

ELIZA: Tell me, why do you hate your father?

It would put the words in a different order, replacing "I" by "you" and so on. Very smart, indeed, but it also depends on the English grammar.

It was used mainly in the situation of a psychiatrist (the program) talking with a patient (or vice versa). In such a situation you expect that the other person does not talk about him or herself and that he/she reuses the things you said.

See also the paper that describes ELIZA in detail (References)

The Turing machine

The name of Alan Turing is closely tied to the theory on computers (especially about what they can and can not do). Alan Turing (look at this page if you want to know more about him and his work - [link]) worked on cryptography and computer theory in the 1930's and 1940's.

His machine, now known as the Turing machine, is a very simple piece of equipment: it reads a tape that has letters and numbers written on it (or simply, symbols) and it can write new symbols onto the tape. It has a "program" that directs it to read the tape, go back, go forth and so on. as a result, the tape is rewritten.

Now this bares no visible resemblance whatsoever to the computers you are used to. But: despite its very limited capabilities, it can do exactly what any computer is able to do (well, with regard to solving problems, not drawing nice pictures on the screen of course).

This puts you back to earth, doesn't it? A stupid machine like that is just as powerful as your fancy computer? The big difference is: it is very cumbersome to write programs for such a machine. So, perhaps we have made progress over the past 70 years :)

Of foos and bars

Sometimes you come across strange words in books on programming, for instance the terms foo and bar:

   proc foo { bar } { 
      ...
   }

I have no idea where these two words come from (a third you can expect is baz). They are used by many programmers to mean some general procedure or variable and indicate a clear lack of imagination :).

Just know that these words are used and that they really mean nothing in particular!

New Page - Edit this Page - Attach File - Add Image - References - Print
Page last modified by lvirden Tue Jun 26/2007 10:22
You must signin to post comments.
Site Home > Young programmers project > Historical notes