The Hundred-Line C# Statement
Tuesday, March 17, 2020
return new MyObject ( new SomeOtherObject(SomeFunction(foo)), SomeBooleanReturningFunction(bar) ? new SomeOtherObject(SomeOtherFunction(baz)) : new YetAnotherObject(...), . . . );Combine the params array with a bunch of nested constructors, ternary operators, and inline logic, and you have what you see here: A 100+ line single statement. Try to breakpoint any single line within the chunk, and you breakpoint the entire statement. A 100+ line statement is not clever. Please... keep it simple! |
||||