-
Notifications
You must be signed in to change notification settings - Fork 2
IO and Hello World
Computer programs can be thought of as entities that manipulate data. It is a common concept that a program will receive data from an input device (a keyboard, a mouse, a microphone, a touchable surface, a magnetic disk - as a file or a database-, a network card, etc.), then it will process the data, and it will output this processed data to an output device (a computer screen, a headphone, a speaker, a TV, a magnetic disk - also as a file or a database-, a network card, etc.). These Input/Output devices are known as IO.
You can also consider that the input or output for a program can be another program, that can run in a different computer, and in that case you would receive input from the network card, and also output to the network card. That is how web programs work. They receive input from another program (your browser) through the network, process data, and send the output to another program (also your browser) also through the network. In this case, the output data is usually a pretty web page data. Then it is the turn of another program (guess who? Yes, your browser again) to get that web page data (as the input), process that data into a set of data representing beautifully arranged light dots (pixels), and send that processed data to an output device, your computer screen.
We will begin with a very simple IO device that has been around for many years: the console. The concept of a console is the combination of a keyboard as input, and a screen as the output. When we say a console application we usually mean a program that will process text only, receiving keystrokes from the keyboard and outputting text to the computer screen. The use of a console as IO is very common, so it is also usually known as the standard input, or stdin, and standard output stdout, in many computer languages.