# Types of Programming Languages

## Progamming Language

**"Programming"** is a method of instructing a computer to carry out specific tasks. Because a computer only understands machine language (0's or 1's, also known as Binary), any human providing commands to the computer to carry out routine tasks becomes extremely difficult.

Programming languages were created to address this issue.

In simple terms, a **programming language** is a computer language that allows humans to communicate with computers by being structured and readable.

## Types of Programming Language


![Types of Programming Language.drawio (1).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1660914291426/v2mbmnG-N.png align="left")

### Procedural Language

- It defines a well-structured set of steps and approaches for writing the program.
- A task is completed using a logical sequence of statements made up of functions and commands.
- Procedural programming follows a top-down approach.
- For example: C, PASCAL

### Functional Language

- Program is written by making use of only pure functions
- It avoid concepts of shared state, mutable data observed in Object Oriented Programming. 
- For example: Haskell, Erlang

### Object-Oriented Language

- Binds related data and functions into an object and encourages reuse of these objects within the same and other programmes.
- Designed primarily to reduce complexity in traditional procedural languages through data binding and encapsulation techniques.
- Object-oriented programming follows a bottom-up approach.
- For example: Java, C#


All of the above concepts are used in modern programming languages, which means that a single language can be procedural, functional, and object-oriented all at the same time.

For example: Java, Python, Ruby

## Static vs Dynamic Programming Language

- One more way to differentiate programming language would be by categerizing them as Static or Dynamic
- Here is a comparison table : 


![Types of Programming Language-Page-2.drawio (1).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1660917907690/LMiupzVKc.png align="left")


### Performance
A compiled language will have higher performance at run-time if it’s statically typed because the knowledge of types allows for machine code optimization.

Statically typed languages offer naturally greater run-time performance since they do not need to check types dynamically while executing (it checks before running).

Similarly, because the code has already been translated, compiled languages are faster at run time than uncompiled languages.

It should be noted that both compiled and statically typed languages will have a delay before executing for translation and type-checking.

### Some more differences
Instead of discovering mistakes during execution, static typing detects them early (especially useful for long programs). It is more "strict" in that it will not tolerate type mistakes anywhere in your programs and regularly stops variables from changing types, which further protects against unintentional errors.

Although dynamic typing is more flexible (which some people like), it permits variables to change types (sometimes creating unexpected errors).

*Did that clear things up for you? Let me know in the comments!
*

