Home

The Types of Programming Languages

|
|  Updated:  
2016-03-26 08:00:43
|   From The Book:  
Getting Started with Coding
Explore Book
Buy On Amazon

Code comes in different flavors called programming languages. Some popular programing languages are shown in the following figure. You can think of programming languages just like spoken languages, as they both share many of the same characteristics, such as:

  • Functionality across languages: Programming languages can all create the same functionality similar to how spoken languages can all express the same objects, phrases, and emotions.

  • Syntax and structure: Commands in programming languages can overlap just like words in spoken languages overlap. To output text to screen in Python or Ruby you use the print command, just like imprimer and imprimir are the verbs for “print” in French and Spanish.

  • Natural lifespan: Programming languages are born when a programmer thinks of a new or easier way to express a computational concept. If other programmers agree, they adopt the language for their own programs and the programming language spreads. However, just like Latin or Aramaic, if the programming language is not adopted by other programmers or a better language comes along, then the programming language slowly dies from lack of use.

    image0.jpg

Despite these similarities, programming languages also differ from spoken languages in a few key ways:

  • One creator: Unlike spoken languages, programming languages can be created by one person in a short period of time, sometimes in just a few days. Popular languages with a single creator include JavaScript (Brendan Eich), Python (Guido van Rossum), and Ruby (Yukihiro Matsumoto).

  • Written in English: Unlike spoken languages (except, of course, English), almost all programming languages are written in English. Whether they’re programming in HTML, JavaScript, Python, or Ruby, Brazilian, French, or Chinese programmers all use the same English keywords and syntax in their code. Some non-English programming languages exist, such as languages in Hindi or Arabic, but none of these languages are widespread or mainstream.

Comparing low-level and high-level programming languages

One way to classify programming languages is either as low-level languages or high-level languages. Low-level languages interact directly with the computer processor or CPU, are capable of performing very basic commands, and are generally hard to read. Machine code, one example of a low-level language, uses code that consists of just two numbers — 0 and 1.

The figure shows an example of machine code. Assembly language, another low-level language, uses keywords to perform basic commands like read data, move data, and store data.

image1.jpg

By contrast, high-level languages use natural language so it is easier for people to read and write. Once code is written in a high-level language, like C++, Python, or Ruby, an interpreter or compiler translates this high-level language into low-level code a computer can understand.

Contrasting compiled code and interpreted code

High-level programming languages must be converted to low-level programming languages using an interpreter or compiler, depending on the language. Interpreted languages are considered more portable than compiled languages, while compiled languages execute faster than interpreted languages. However, the speed advantage compiled languages have is starting to fade in importance as improving processor speeds make performance differences between interpreted and compiled languages negligible.

High-level programming languages like JavaScript, Python, and Ruby are interpreted. For these languages the interpreter executes the program directly, translating each statement one line at a time into machine code. High-level programming languages like C++, COBOL, and Visual Basic are compiled. For these languages, after the code is written a compiler translates all the code into machine code, and an executable file is created.

This executable file is then distributed via the Internet, CD-ROMs, or other media and run. Software you install on your computer, like Microsoft Windows or Mac OS X, are coded using compiled languages, usually C or C++.

Programming for the web

Software accessible on websites is gradually starting to take over installed software. Think of the last time you downloaded and installed software for your computer — you may not even remember! Installed software like Windows Media Player and Winamp that play music and movies have been replaced with websites like YouTube and Netflix.

Traditional installed word processor and spreadsheet software like Microsoft Word and Excel are starting to see competition from web software like Google Docs and Sheets. Google is even selling laptops called Chromebooks that contain no installed software, and instead rely exclusively on web software to provide functionality.

The remainder of this book will focus on developing and creating web software, not just because web software is growing rapidly, but also because programs for the web are easier to learn and launch than traditional installed software.

About This Article

This article is from the book: 

About the book author:

Nikhil Abraham was Director of Business Development & Growth at Codecademy. In that role, he taught and trained thousands of beginning coders across a variety of professions. He helped refine Codecademy's online courses, which have introduced basic coding skills to millions of learners.