Six Things

 
 

We have six simple operations that every computer can do, each of which most programming languages express in a single command -- or perhaps several single commands, each doing the same thing in a slightly different way -- and which if you understand them and how to spell them in any particular programming language such as Java, you can program anything in that language that can be programmed. Five of them refer to basic one-line computer operations, and the sixth is a way of collecting and giving a name to a group of operations, so that you can refer to (and run) that whole group by a single command. We have given these short names to the operations, and a big part of how we teach you to program in Java is by reference to these six concepts:

Sequence, the idea that programs execute in the order you specify in your program, and that any program or program fragment is a sequence of operations, each one of these six.

Iteration is the idea that a sequence of steps can be repeated multiple times in the computer, but written as a single sequence in the program.

Conditional is the name we give to the idea that the computer can make a decision based on some data (see Variables, below), and then do one part of the program or another (but not both, at least not at that time).

Variables are places in the computer memory where numbers or other data values are stored, and we use the term also to collectively refer to the process of computing a single value to be stored in a variable.

Input/Output refers to the transfer of data to variables from outside the computer, and from variables to outside the computer. Input is whatever values the programmer did not know when the program is written, so it must enter the computer when the program is run. Output is calculated results that are saved off outside the computer, or else presented as text or images and sound to be seen (and heard) by humans. Controlling external hardware (like steering a car or making a robot walk or cycling a washing machine through its phases or turning lights on or off) also is output.

Subroutines, also called Objects, are any collection of data and program code to which a name can be given, so that that code can be "called" from anywhere in the program where the name is visible, and it runs as if the code had been fully spelled out in the sequence from where it was called. Subroutines are code-centric and Objects are data-centric (the contained subroutines can only be called by reference to some existing data), but otherwise there is no fundamental difference.

Links

Why 6?
Six Things Summary (English)
Six Ideas in Java
Six Things (in Things You Need to Know)
 


[Rev. 2022 February 10a]