Java```
void Execute() {
ReadInput();
ProcessData();
GenerateOutput();
}
```

Java```
void MoreOpenExecute() {
InputData input = ReadInput();
ResultData result = ProcessData(input);
OutputData output = GenerateOutput(result);
}
```

Java```
void FunctionalExecute() {
GenerateOutput(ProcessData(ReadInput()));
}
```

F#```
ReadInput
|> ProcessData
|> GenerateOutput
```

F#`ReadInput |> ProcessData |> GenerateOutput`

Java```
void FluentExecute() {
ReadInput().ProcessData().GenerateOutput();
}
```

Another example: arithmetic calculations

Let us take another very simple example: trivial arithmetic calculations. To make it even more trivial, we will limit arithmetic operations to a single one: **Add**.

Java```
int Add(int x, int y) {
return x + y;
}
void Main() {
int a = Add(2, 5);
int b = Add(a, 4);
int c = Add(b, 6);
}
```

Java`int d = Add(Add(Add(2, 5), 4), 6);`

F#```
let add x y = x + y
add 2 5
|> add 4
|> add 6
```

F#```
let square x = x * x
let quad x = x |> square |> square
```

F#`let quad = square >> square`

Functional programming is about stateless transformations

Functional programming is not about classes, it is about stateless transformations of immutable things, where «things» can be both data and functions, or even partially applied functions. Therefore we should not think about these transformations as changes of values. It is more a matter of mapping input to output where both sides can contain plain data or functions.