It may seems possible but it will not be a pure functional programming. It may results to imperative programming.
There is no asking why he mean by possible functional programming as mentioned by haylem. Here it is:
It depends what you mean by "functional programming" and by
"possible".
Functional programming cannot have different definitions or meaning though it may have many explanations.
Like OOP, can we ask "what do you mean by OOP?".
Definitely there will be lot of explanations but it will just pertain to one objective, the objective of OOP.
The same applies to functional programming.
When we say functional meaning the programs consist of functions.
The role of the functions is to return an evaluated argument/parameter (argument is variable is the expression came when calling the function while parameter is variable that is a part of the function declaration).
Also functions will always return the same result when same arguments is passed. In that way it is easier to avoid bugs or debug future bugs. By functional programming we can avoid side effects like modifying global variable.
example in JavaScript:
function increment(lis){
return lis.map(
function (x){
return x+2;
}
);
}
var myList = [4, 7, 2, 3];
console.log(increment(myList));
console.log(myList);
The function increment adds 1 value to each of the element inside object and return the result. The value of myList did not change but when we call the functions we saw the added value to elements of that object.
As my response to Is Functional Programming possible in Java?, I believe that it is not possible to have true functional programming in java. Because java is really designed to be OOP in which it extends imperative programming and improved it for maintainability. When the state of an object, variable etc, has changed then, that is already an imperative programming.