You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to suggest an improvement regarding the current usage of chained calls within TiDB. Currently, we have instances where chained calls are directly used within function calls. This practice causes inconvenience, especially when debugging, as it forces us to step into each of these chained calls, making the process cumbersome.
To enhance our debugging experience and code maintainability, I propose that we avoid using chained calls directly within function calls. Instead, we should break them down into intermediate variables or steps before passing them to the function. This approach would not only simplify debugging but also improve code readability.
Here is an example to illustrate the suggested change:
// the candidate predicate should be a constant and compare predicate
match := validCompareConstantPredicate(selection.SCtx().GetExprCtx().GetEvalCtx(), candidatePredicate)
if match {
result = append(result, candidatePredicate)
}
Proposed Change:
// the candidate predicate should be a constant and compare predicate
ctx := selection.SCtx().GetExprCtx().GetEvalCtx()
match := validCompareConstantPredicate(ctx, candidatePredicate)
if match {
result = append(result, candidatePredicate)
}
By adopting this approach, we can set breakpoints at each intermediate step and inspect the values more easily without stepping into each chained call unintentionally.
I believe this improvement will significantly streamline our debugging process and enhance overall code quality. Your consideration and feedback on this suggestion would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Enhancement
I would like to suggest an improvement regarding the current usage of chained calls within TiDB. Currently, we have instances where chained calls are directly used within function calls. This practice causes inconvenience, especially when debugging, as it forces us to step into each of these chained calls, making the process cumbersome.
To enhance our debugging experience and code maintainability, I propose that we avoid using chained calls directly within function calls. Instead, we should break them down into intermediate variables or steps before passing them to the function. This approach would not only simplify debugging but also improve code readability.
Here is an example to illustrate the suggested change:
Proposed Change:
By adopting this approach, we can set breakpoints at each intermediate step and inspect the values more easily without stepping into each chained call unintentionally.
I believe this improvement will significantly streamline our debugging process and enhance overall code quality. Your consideration and feedback on this suggestion would be greatly appreciated.
The text was updated successfully, but these errors were encountered: