var iWantMyLength = new MyClass() // class instance with a bunch of properties and field .SetMethod1(paramerter1) // some field changed compare to previous line .SetMethod2(paramerter2) // another difference .ToString() // exported string via override method .Trim() // remove not need space .Length; // get final string length and put into "iWantMyLength" make it int32
In this crap demo you can see I will meet three different class instance "snapshot"
a string, a trimmed string and a length.
The entire process is similar to "LINQ" but because it was actually not a LINQ,
Visual Studio itself, or OzCode visual studio extension will not display each return value.
Result in when I "step over", I only get final length...The entire calling process are lost.
If I have a bug, I must separate this statement into the following:
var wantMyLengthClass1 = new MyClass(); var setResult1Class1 = wantMyLengthClass1.Clone() // copy because class instance are reference .SetMethod1(paramerter1); // put into setResult1 var setResult2Class1 = wantMyLengthClass1.Clone() .SetMethod2(paramerter2); // i want to see the difference between calls var getString1 = setResult2Class1.ToString(); // i want to see what is raw string var getTrimmedString1 = getString1..Trim(); // i want to see difference after trim var iWantMyLength1 = getString1.Length; // finally... // I want more samples, so I have to... var wantMyLengthClass2 ... var setResult1Class2 ... var setResult2Class2 ... var getString2 ... var getTrimmedString2 ... var iWantMyLength2 ...
The fact is such statement are very annoying and will let you to think
why chaining method call feature even exist, without any kind of return value check.
So the idea is when step though a chained method call,
save each return value as a snapshot copy, display on magic glance HUD or something
Then the best is able to compare the snapshot values in different stage.
Customer support service by UserEcho