Programming Language

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

Overview

A programming language is a language. Sometimes we think of a language as including all the tools people typically use to write programs in that language and run them, but really, those are entirely separate things.

Common Features

Most languages have these features.

Sometimes they incorporate other ideas.

Two Types of Languages

There are, broadly, two types of languages.

  • Imperative, which tells the computer *what* to do and how to do it.
  • Descriptive, which tells the computer the parameters of the problem and asks it to solve it.

There really isn't a huge amount of difference between these types of languages, because Compilers can often infer what you want done from the instructions you give in imperative languages.

Languages such as Prolog and SQL are good examples of descriptive languages. Most other languages are imperative, but usually feature descriptive elements at sufficiently high abstraction.

Abstraction

Abstraction is such an important topic in programming. In short, programming languages make the difficult task of feeding a CPU a sequence of instructions more or less easy by glossing over key details that the CPU needs.

References and Indirection

Another powerful concept is referring to other things, and referring to those referrals. When you have a language that is sufficiently powerful that it can talk about itself, then you have something very special. If talking about itself requires additional language elements not present in the base language, then you have something where creating references and abstractions may be a lot of work.

Data Types

Most languages have at their core a set of data types. This includes things like numbers and strings, but can also include compound data types like hashes, lists, etc... Some languages embrace these data types and incorporate them into their core elements. Others do not.


Read Write vs. Write Only

This is a very important point about many programming language. How hard is it to read code written in the language?

"Read / Write" code is code meant to be read (as well as written.) Your programs should be readable.

"Write Only" code is code that, once written, cannot be understand by mere mortals, often including the author themselves.