What is Programming?

In the logician's voice:

an algorithm is

a finite procedure,

written in a fixed symbolic vocabulary,

governed by precise instructions,

moving in discrete steps, 1, 2, 3,...,

whose execution requires no insight, cleverness, intuition, intelligence, or perspicuity,

and that sooner or later comes to an end.

From The Advent of the Algorithm, by David Berlinski


Edit-Compile-Run Cycle

Practical Steps for Creating and Running a Program involve the following steps

  1. Edit: Type the Java code into a text file. Any word processor will do as long as you make sure you save to a "text" file. Make sure the file has extension .java. For example, myProg.java.
  2. Compile: Use the Java compiler (javac) to convert from the text file to bytecode. The compiler will create a new file with the same name as the text file but with the extension .class. For example, myProg.class. The bytecode can (in theory) be transferred to any other computer and executed.
  3. Debug: If there are any errors in your .java program, error messages will be generated and the .class file will not be created.
  4. Run: To actually run (execute) the program, you run the Java interpreter. There may be execution errors such as divide by zero.

Visual Cafe (VC)

Visual Cafe is called an Integrated Enviroment because it combines all of the following for you:

  1. A text editor that has special features convenient for Java. For example, color coding of the code and some error checking.
  2. Most Java programs consist of multiple text files. VC requires that you create a project which organizes all of your files.
  3. VC has a debugger which help you find errors in your program.
  4. VC has online Java API documentation so you can easily look up information about the classes in the Java libraries.
  5. When you execute your program in VC, it combines the Java compile and the Java interpreter into one step.
  6. Downside: "Integrated Environments" for programming are inherently very complex and take sometime to learn. They also can frequently crash so it is important to always keep back-ups of your work in a separate folder. Also, you should save your work frequently.

To create a program in Visual Cafe, you must:


next lecture