Say I have some code like this
var addResult = GetAddResult(num1, num2);
var transformedResult = TransformResult(addResult );
if(CheckValidity(transformedResult))
{
SendResult(transformedResult);
}
else
{
LogError(transformedResult);
}
I am writing such code in many places. Basically it is a function calls where the return value of one is the input of another. Also there are flow changes depends on some conditional checks.
Is there a way to write this in a more readable way?
For example
ExecuteFlow.GetAddResult(num1,num2).TransformResult.CheckValidity.IfTrue.SendResult.IfFalse.LogError
;
Apologies for this is more of a conceptual clarification. But I would like to know if such a technique is feasible.