By Barry Burd

Java helps computer do many complex things, all of which make our lives easier. It would be so nice if all the complexity of computers were free, but unfortunately, it isn’t. Someone has to think hard and decide exactly what to ask the computer to do. After that thinking, someone has to write a set of instructions for the computer to follow.

Given the current state of affairs, you can’t write these instructions in English or any other language that people speak. Science fiction is filled with stories about people who say simple things to robots and get back disastrous, unexpected results. English and other such languages are unsuitable for communication with computers for several reasons:

  • An English sentence can be misinterpreted. “Chew one tablet three times a day until finished.”

  • It’s difficult to weave a very complicated command in English. “Join flange A to protuberance B, making sure to connect only the outermost lip of flange A to the larger end of the protuberance B, while joining the middle and inner lips of flange A to grommet C.”

  • An English sentence has lots of extra baggage. “Sentence has unneeded words.”

  • English is difficult to interpret. “As part of this Publishing Agreement between John Wiley & Sons, Inc. (‘Wiley’) and the Author (‘Barry Burd’), Wiley shall pay the sum of one-thousand-two-hundred-fifty-seven dollars and sixty-three cents ($1,257.63) to the Author for partial submittal of Java For Dummies, 6th Edition (‘the Work’).”

To tell a computer what to do, you have to use a special language to write terse, unambiguous instructions. A special language of this kind is called a computer programming language. A set of instructions written in such a language is called a program. When looked at as a big blob, these instructions are called software or code. Here’s what code looks like when it’s written in Java:

public class PayBarry {
    public static void main(String args[]) {
        double checkAmount = 1257.63;
        System.out.print("Pay to the order of ");
        System.out.print("Dr. Barry Burd ");
        System.out.print("$");
        System.out.println(checkAmount);
    }
}

Computer programs work like a recipe… you can use a ready-to-bake cake mix, or you can start from scratch. You can use somebody else’s program or write your own. If you use somebody else’s program, you use whatever you get. When you write your own program, you can tailor the program especially for your needs.

Writing computer code is a big, worldwide industry. Companies do it, freelance professionals do it, hobbyists do it — all kinds of people do it. A typical big company has teams, departments, and divisions that write programs for the company. But you can write programs for yourself or someone else, for a living or for fun.

In a recent estimate, the number of lines of code written each day by programmers in the United States alone exceeds the number of methane molecules on the planet Jupiter. Take almost anything that can be done with a computer.

With the right amount of time, you can write your own program to do it. (Of course, the “right amount of time” may be very long, but that’s not the point. Many interesting and useful programs can be written in hours or even minutes.)