Computer Programming Languages
Programming is the act of defining the operations needed to achieve a desired outcome.
A programming language defines the vocabulary and set of grammatical rules which comprise a set of instructions for how to implement a program.
A computer programming language specifically instructs a computer or computing device to perform computations or run algorithms.
Programming Interface
Text-based
Block-based
Syntax
The syntax of a computer language is the set of rules which define the symbols and how they are structured to correctly produce statements or expressions in that language.
Statements
A statement is a complete line of code that performs some action.
Example statemens:
if CONDITION:
elif CONDITION:
else:
for VARIABLE in SEQUENCE:
while CONDITION:
try:
except EXCEPTION as e:
class MYCLASS:
def MYFUNCTION():
return SOMETHING
raise SOMETHING
with SOMETHING:
Expressions
An expression is any section of code that evaluates to a value. Expressions can be printed and assigned to a variable. Every expression can be used as a statement (whose effect is to evaluate the expression and ignore the resulting value), but most statements cannot be used as expressions.
Example expressions:
2 + 2
3 * 7
1 + 2 + 3 * (8 ** 9) - sqrt(4.0)
min(2, 22)
max(3, 94)
round(81.5)
"foo"
"bar"
"foo" + "bar"
None
True
False
2
3
4.0
Compiled vs Interpreted
- Compiled
- Interpreted
Theoretically, scripting languages do not need to be compiled before run-time, rather they are interpreted at run-time. In practice, the distinction between the two is getting blurred owing to improved hardware and coding practices. For instance, Javascript, a classically scripted and interpreted language can now be used with Node, a compiler which uses V8 the JavaScript engine in Google Chrome browsers to compile the code into machine code, rather than interpreting it.
Language Types
Computer programming languages fall under two main types:
Domain Specific
A language Designed for a specific purpose (handling database queries, handling documents, configuring programs). These languages are generally pretty good for the purpose they were designed, but aren’t flexible so you can’t apply them to other problems.
General Purpose
General-purpose programming languages are designed to write software that will be used to solve a wide range of problems. They have several application domains. They are known as general-purpose because they are designed not to solve any specific problem. Instead, they cover a wide range of problems.
Markup Languages
This is a markup language that is used for more than one purpose but usually for making structures. Some of these languages include XML and HTML.
Modeling Languages
These type of general purpose programming languages are used to create a representation of a system. One such language is Unified Modelling Language (UML)
Programming Paradigms
Programming paradigms are a way to classify programming languages based on their features. Learn more about programming paradigms on Wikipeadia.
Common programming paradigms include:
Imperative
The programmer instructs the machine how to change its state.
Procedural
Groups instructions into procedures.
Object-oriented
Groups instructions together with the part of the state they operate on.
Declarative
The programmer declares properties of the desired result, but not how to compute it.
Functional
The desired result is declared as the value of a series of function applications.
Logic
The desired result is declared as the answer to a question about a system of facts and rules.
Mathematical
The desired result is declared as the solution of an optimization problem.
Popular Programming Languages
TIOBE Index
The TIOBE Programming Community index is an indicator of the popularity of programming languages and is a good tool to track trends in the programming industry. To learn more visit tiobe.com/tiobe-index where you can also see their calculation method.
The 15 most popular programming languages (according to the TIOBE index) are: