1580.md

May 11, 2020 ยท View on GitHub

Because debugger breakpoints cannot be set inside expressions, avoid overuse of nested method calls. For example, a line like:

string result = ConvertToXml(ApplyTransforms(ExecuteQuery(GetConfigurationSettings(source))));

requires extra steps to inspect intermediate method return values. On the other hard, were this expression broken into intermediate variables, setting a breakpoint on one of them would be sufficient.

Note This does not apply to chaining method calls, which is a common pattern in fluent APIs.