> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/all/cs_fundamentals/languagetypes.md).

# Language Types

## OOP, Functional, Declaritive

### OOP(Object Oriented Programming)

Encapsulate and inherit data and functions in objects/classes, mutable (C++, Java, Javascript)

### Declarative

Express logic in code, and control flow is deduced

E.g SQL, Prolog

### Functional

functions are first class, immutable (Elixir, Haskell)

Pros

* simpler rules
* better parallelism because no race conditions
* more bug free/easier to debug&#x20;

Cons

* performance can be bad&#x20;
* harder to logic sometimes
* harder to hire for&#x20;

**Statically Typed**: Variables have specific types at compiletime

**Dynamically Typed**: Variables define their type at runtime

**Strongly vs Weakly Typed** : About if it automatically converts float to integers or strings or it must be explicit

### Compiled Vs Interpreted

In principle, not a lang characteristic as you can compile or interpret a lang

#### Compiled

C++ and Java are compiled meaning they are turned in byte code and need to be precompiled

#### Interpreted

Python, JS is interpretrated meaning it is turned into byte code as needed

* Garbage collection
* dont have to define types

## Other Paradigms

#### Map Reduce

Map ft - process key/value to generate intermediate key/value

Reduce ft - merges all intermediate values with same key

Implementation handles parallelization, machine failure, and data locality/optimization

Ship computation to machine that holds needed data instead of data to compution

*Implementation: Master Slave with 64MB block size and redundancy, commodity machines*
