Classifications of High-Level Languages in Programming
High-level languages create programs that are easier for a human to decipher, as opposed to low-level languages, which a machine can more easily execute. They can be classified by paradigms, i.e., classifications of abstractions used to understand the control structure of the language. Programming languages do not "descend" from other languages. However, language designers borrow concepts and syntax from other languages. This makes new languages easy to learn once you've mastered the basic paradigm.
-
Language Typing
-
The approach to language typing differs by language. Typing refers to the classification of data as a type, and whether or not one type of data can be treated as another type of data by a program. For instance, any number, alphanumeric character or true/false value is represented by a binary value. Therefore, without typing, you could make a legal expression that calculates the value of the symbol "!" divided by 2. Typed languages prevent this, and static-type languages test typing before the program executes, typically when compiled.
Compiled and Interpreted Languages
-
Compiling a language converts it to machine code, and compiled languages are designed to be run in such a way. By contrast, an interpreted language runs because an interpreter program scans the language syntax and follows the logical orders it finds, without needing to compile it beforehand. The distinction between compiled and interpreted languages is mostly a matter of the preference of the language designer -- in theory, any language can be either compiled or interpreted. Interpreted languages are also called "scripting languages." C++, most BASIC dialects and Common Lisp are all compiled languages. Perl and Python are interpreted languages. Java combines both compiled and interpreted paradigms, in which normal Java code is compiled to Java bytecode, which is then interpreted by the Java Virtual Machine.
-
Declarative vs Imperative
-
Programming languages can embody declarative or imperative paradigms: driven by computational logic or control flow. Languages designed with the declarative paradigm specify what a machine should accomplish, without necessarily stating how it should be done. They include languages dedicated to a specific problem domain, such as HTML, and functional programming languages without a persistent state, such as Lisp. The imperative paradigm, by contrast, treats a program as a series of commands that change the state of the program. Procedural languages such as C are imperative, and structured languages, like Java, use the imperative style. Some languages, like those found in a makefile used to build programs, use both declarative and imperative styles.
Structured and Object-Oriented
-
A special class of imperative languages, structured languages divide program logic into discrete subsections to reduce "spaghetti code," or random logic jumps to difficult-to-follow parts of the program. The structured approach became solidified by object-oriented programming, which divided code snippets into classes and methods. Java and C++ are object-oriented programming languages.
Metaprogramming
-
"Metaprogramming" refers to programs which act on other programs. Some languages are designed specifically for metaprogramming. The Make language, for instance, is a simple scripting language which compiles and runs programs written in compiled languages like C. C++ and Python also exhibit metaprogramming characteristics.
-
References
Resources
- Photo Credit Comstock/Comstock/Getty Images