Programming Languages

FIELDS OF STUDY

Computer Engineering; Software Engineering; Applications

ABSTRACT

A programming language is a code used to control the operation of a computer and to create computer programs. Computer programs are created by sets of instructions that tell a computer how to do small but specific tasks, such as performing calculations or processing data.

PRINCIPAL TERMS

WHAT ARE PROGRAMMING LANGUAGES?

Programming languages are constructed languages that are used to create computer programs. They relay sets of instructions that control the operation of a computer. A computer's central processing unit operates through machine code. Machine code is based on numerical instructions that are incredibly difficult to read, write, or edit. Therefore, higher-level programming languages were developed to simplify the creation of computer programs. Programming languages are used to write code that is then converted to machine code. The machine code is then executed by a computer, smartphone, or other machine.

There are many different types of programming languages. First-generation, or machine code, languages are processed by computers directly. Such languages are fast and efficient to execute. However, they are difficult for humans to read and require advanced knowledge of hardware to use. Second-generation languages, or assembly languages, are more easily read by humans. However, they must be converted into machine code before being executed by a computer. Second-generation languages are used more often than first-generation ones because they are easier for humans to use while still interacting quickly and efficiently with hardware.




On the TIOBE index for various programming languages, C and Java are the highest-rated languages.





On the TIOBE index for various programming languages, C and Java are the highest-rated languages.

Both first- and second-generation languages are low-level languages. Third-generation languages are the most widely used programming languages. Third-generation, or high-level programming, languages are easier to use than low-level languages. However, they are not as fast or efficient. Early examples of such languages include Fortran, COBOL, and ALGOL. Some of the most widely used programming languages in the twenty-first century are third-generation. These include C++, C#, Java, JavaScript, and BASIC. Programming languages with higher levels of abstraction are sometimes called fourth-generation languages. Higher levels of abstraction increases platform independence. Examples include Ruby, Python, and Perl.

Programming languages can be based on different programming paradigms or styles. Imperative languages, such as COBOL, use statements to instruct the computer to perform a specific sequence of operations to achieve the desired outcome. Declarative languages specify the desired outcome but not the specific sequence of operations that will be used to achieve it. Structured Query Language (SQL) is one example.

Programming languages can also be classified by the number of different computations they can perform. Turing complete programming languages can perform all possible computations and algorithms. Most programming languages are Turing complete. However, some programming languages, such as Charity and Epigram, can only perform a limited number of computations and are therefore not Turing complete.

HOW PROGRAMMING LANGUAGES ARE STRUCTURED

Abstraction reduces the structural complexity of programs. More abstract languages are easier to understand and use. Abstraction is based on the principle that any piece of functionality that a program uses should be implemented only once and never duplicated. Abstraction focuses only on the essential requirements of a program. Abstraction can be implemented using subroutines. A subroutine is a sequence of statements that perform a specific task, such as checking to see if a customer's name exists in a text file. If abstraction is not used, the sequence of statements needed to check if a customer's name exists in the file would need to be repeated every place in the program where such a check is needed. With subroutines, the sequence of statements exists in only one place, within the subroutine. Thus, it does not need to be duplicated.

SAMPLE PROBLEM

The pseudocode below describes an algorithm designed to count the number of words in a text file and to delete the file if no words are found:

Open the file
For each word in file
counter = counter + 1;
If counter = 0 Then
Delete file
Close the file

Use the pseudocode to describe an algorithm that counts the number of words in a file and then prints the number of words if the number of words is greater than 300.

Answer:

Open the file
For each word in file
wordcount = wordcount + 1;
If wordcount > 300 Then
print wordcount
Close the file

The pseudocode above uses natural language for statements such as Open the file and programming language for statements such as wordcount = wordcount + 1. Pseudocode cannot be executed by a computer. However, it is helpful for showing the outline of a program or algorithm's operating principles.

USING PSEUDOCODE

The programming language statements that comprise a program are called “code.” Code must comply with all of the programming language's syntax and semantic rules. Pseudocode uses a combination of a programming language and a natural language such as English to simply describe a program or algorithm. Pseudocode is easier to understand than code and is often used in textbooks and scientific publications.

THE FUTURE OF PROGRAMMING LANGUAGES

Programming languages are growing in importance with the continued development of the Internet and with the introduction of new programmable machines including household appliances, driverless cars, and remotely controlled drones. Such systems will increase the demand for new programming languages and paradigms designed for larger, more complex, and highly interconnected programs.

—Maura Valentino, MSLIS

Belton, Padraig. “Coding the Future: What Will the Future of Computing Look Like?” BBC News. BBC, 15 May 2015. Web. 24 Feb. 2016.

Friedman, Daniel P., and Mitchell Wand. Essentials of Programming Languages. Cambridge: MIT P, 2006. Print.

Harper, Robert. Practical Foundations for Programming Languages. Cambridge: Cambridge UP, 2013. Print.

MacLennan, Bruce J. Principles of Programming Languages: Design, Evaluation, and Implementation. Oxford: Oxford UP, 1999. Print.

Scott, Michael L. Programming Language Pragmatics. Burlington: Kaufmann, 2009. Print.

Van Roy, Peter. Concepts, Techniques, and Models of Computer Programming. Cambridge: MIT P, 2004. Print.

Watt, David A. Programming Language Design Concepts. West Sussex: Wiley, 2004. Print.

Woods, Dan. “Why Adopting the Declarative Programming Practices Will Improve Your Return from Technology.” Forbes. Forbes.com , 17 Apr. 2013. Web. 2 Mar. 2016.