Week 13 · 13.3 · Wed, Oct 28 · I Do reading
Programming Languages and Where Java Came From
1 This section explains what a programming language is, how a person's code becomes something a computer can run, and where the Java language came from.
Programming Languages
2 On October 14, the class read that a program is a set of instructions that a person wrote, while a model is trained on examples. Monday's passage showed that everything in an AI tool except the model is an ordinary program, written by people in a programming language.
3 A programming language is a set of words, symbols and rules for writing instructions that a computer can carry out. Each programming language has strict rules about how a statement is built and which symbols may appear in it. A statement in a programming language is designed to have exactly one meaning, wherever it appears. English is not a programming language, because nobody designed it for computers and many English sentences can mean two different things. For example, "The coach saw the player with the camera" does not say who has the camera, so a computer could not run it. Java is one programming language, and Python and JavaScript are two others.
Source Code and the Compiler
4 Source code is the text that a person writes in a programming language. It is meant to be read by people as well as by the computer. In Java, source code is saved in plain text files whose names end in .java. The short program below is Java source code that a person could type into a file named Main.java. The class will read code like this in November.
1public class Main { 2 public static void main(String[] args) { 3 System.out.println("Hello from McDonogh 35"); 4 } 5}
Hello from McDonogh 35
5 A compiler is a program that reads source code, checks that it follows the language's rules, and turns it into a form the computer can run. Java's compiler is a program called javac. First, a person saves the source code as Main.java. Next, the person runs javac on that file. Then javac checks every statement against the rules of Java. If a rule is broken, such as a missing semicolon, javac reports an error with its line number and makes no new file. If there are no errors, javac writes a new file named Main.class, which the computer can run.
6 The person writes the source code, and the compiler does the turning. A compiler is not the person who wrote the program, because it only checks and turns instructions that a person already wrote. The Main.class file is not source code either, because the compiler made it and no person typed it. Figure 1 shows these steps as three boxes.
Where Java Came From
7 Java began inside a small research group at Sun Microsystems called the Green Project. In a 2019 interview, James Gosling said the project started at the very end of 1990 and ended in September 1992. The group studied consumer electronics such as TVs and VCRs. Gosling, often called the father of Java, was the only member who had built a compiler before. He volunteered to make the C language safer for those devices, and that work grew into a new language. According to his own account, he named the language Oak after an oak tree outside his office window.
8 The devices the group studied were built with many different kinds of chips. A company that changed to a new chip often had to rewrite large parts of its code. For this reason, the group wanted code that could move to a different chip without being rewritten. Trademark lawyers found too many conflicts with the name Oak, so the team chose the name Java instead. Sun introduced Java to the public on May 23, 1995. Java later became known for the slogan "write once, run anywhere," which Gosling has described as a marketing line. Oracle completed its purchase of Sun on January 27, 2010, and Oracle now looks after Java.
Java and JavaScript
9 Java and JavaScript are two different programming languages. JavaScript was created at Netscape in 1995 by Brendan Eich. In December 1995, Netscape and Sun announced the name JavaScript as part of a partnership between the two companies. The companies linked the two names, even though the designs of the languages were only alike on the surface. Mozilla's documentation tells readers not to confuse the two languages, and it notes that both names are trademarks of Oracle. In this class, Java code is always called Java. The next lesson explains why so many people chose Java and what "write once, run anywhere" means.
Summary
10 A programming language is a set of words, symbols and rules for writing instructions, and source code is the text a person writes in one. A compiler such as javac checks source code against the language's rules and turns it into a form the computer can run. Java began in Sun's Green Project under the name Oak, was introduced in 1995, and has been looked after by Oracle since 2010.
Sources: Oracle, The Java Tutorials: About the Java Technology; Oracle, The javac Command (Java SE 21); Oracle, The Java Tutorials: Common Problems; Downey and Mayfield, Think Java (2020); Downey, Think Python, 2nd ed.; Gosling, Oral History of James Gosling (Computer History Museum, 2019); Krill, Java turns 30 (InfoWorld, 2025); Wirfs-Brock and Eich, JavaScript: The First 20 Years (2020); Oracle, Oracle Completes Acquisition of Sun (2010); Oracle, Java Software; Mozilla, JavaScript (MDN Web Docs).