ulox icon indicating copy to clipboard operation
ulox copied to clipboard

Unpleasant shapes

Open stevehalliwell opened this issue 1 year ago • 0 comments

There are two code shapes we encounter that are unpleasant and non-obvious to skim over.

if(need a)
{
   do a thing
  
  //because need a d we also need b
  if(need b)
  {
    do b thing

   //because we need a and need b, we also need c?
   //etc.
  }
}

and

var resA = FuncA(something);
var resB = FuncB(resA);
var resC = Funcc(resB);
//etc.

//or worse
var lastRes = FuncN(FuncN1(FuncN2 ... );

They are a conflict between location where logic must be placed and the implication of scoping.

Sequences of operations that in c# we might use select with lambdas. f# might use |>.

stevehalliwell avatar Dec 29 '23 20:12 stevehalliwell