csharpier
csharpier copied to clipboard
Should a single parameter method call never break
When a method call has a single parameter, it is sometimes long enough to cause it to break like so
CallMethod(
parameter
);
If there is just the single parameter, we could never break. But that could lead to some long lines. Test it out on the forked repos to see what kind of edge cases there are.
As a user, I would be fine with either.
From a dev perspective, I would say no because I don't see enough benefits to warrant a special case.
There are some interesting side effects that make me want to explore it more.
Ones that are better
string disableSuppressRedirect = appSettings.Get(
AppSettingsSuppressFormsAuthenticationRedirectKey
);
// is now
string disableSuppressRedirect =
appSettings.Get(AppSettingsSuppressFormsAuthenticationRedirectKey);
callMethod(
() =>
{
return;
}
);
// is now
callMethod(() =>
{
return;
});
Ones that are worse
CompletedAsyncResult<T> completedResult = AsyncResult.End<CompletedAsyncResult<T>>(
result
);
// is now
CompletedAsyncResult<T> completedResult = AsyncResult.End<
CompletedAsyncResult<T>
>(result);
_security.Transport.ConfigureTransportProtectionAndAuthentication(
_httpsTransportBindingElement
);
// could now get super long
_security.Transport.ConfigureTransportProtectionAndAuthentication(_httpsTransportBindingElement);