The first step in programming is choosing a programming language. As we have already discussed, languages generally differ in what types of programs they can be used to generate, and these programs can usually be divided into native applications that execute bytecode on the actual CPU and interpreted applications that execute bytecode in a virtual machine. (As a side note, some interpreters do not generate bytecode at all but simply read the language and execute high-level commands directly, but this is much less efficient). Of the popular high-level programming languages there are countless numbers to choose from. C\C++ and Object Pascal are among the most common native languages. C#, Perl, Python, PHP, Java, Javascript, Actionscript, Matlab, Maple, and Mathematica to name a few are some popular interpreted languages which in some cases can also be compiled into native code. As you might be able to guess, interpreted languages are considered higher level than native languages because they add another layer of abstraction between the programmer and the processor. The following table lists programming languages starting at the most low level and continuing to the most high level along with some well-known applications written in each language.
Language | Level | Execution | Common Applications |
x86 Assembly | Low | Native | Almost all modern PC/Mac applications compile into this language at some point; however, few are written directly in this language. |
C | High | Native | Hardware drivers are often written in C along with a few applications. |
C++ | High | Native | Firefox, Microsoft Word, Adobe Photoshop, etc. |
Object Pascal | High | Native | Skype |
Java | Highest | Interpreted | Eclipse programming environment, many websites that contain applets. |
Javascript | Highest | Interpreted | Most modern websites have at least some javascript (which is very different than Java). |
Python | Highest | Interpreted | General purpose language that emphasizes code readability. Introduces a number of fairly unique concepts such as coroutines. |
Perl | Highest | Interpreted | Primarily used for shell scripting. Especially useful for processing text containin regular expressions. |
PHP | Highest | Interpreted | Hypertext preprocessor used by a number of websites including Wikipedia and Facebook. |
Matlab, Maple, Mathematica | Highest | Interpreted | Used in mathematic/scientific computing. |
The choice of a language is dependent on the type of program to be written and the programmer's experience with that language. Again in an analogy to creative writing, it is much easier to write a novel in English if English is your first language than in Dutch if you have had only one class in Dutch. As you learn to program in different languages you will likely develop a preference and proficiency in one or more; however, in this book we assume no prior knowledge of any languages. For this reason, we have chosen the Object Pascal language due to its straightforward syntax and its position as a native language. Learning a high-level native language first can lead to the ability of writing more efficient code when one moves to an interpreted language for reasons you will understand by the end of this book. If you do not already have an Object Pascal compiler provided for you, now would be the time to read
Appendix A which will explain how to obtain a free version of the Object Pascal compiler.