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
{{ message }}
Repository navigation
Consider hiding legacy overloads for Math.DivRem #44829
#42156 introduced some new overloads for Math.DivRem which follow more modern API design practices (and have way better naming). I think it would make sense to hide the existing ones to avoid potential confusion and save on some Intellisense real estate. The new overloads are functionally the same.
Proposed API
namespace System
{
public static class Math
{
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static int DivRem(int a, int b, out int result);
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static long DivRem(long a, long b, out long result);
}
}
Risks
The primary risk would be confusion among people who could be surprised to see the existing overloads disappear. I think it is low though, as the new signatures are quite self-explanatory. Note: this change only impacts new code, so it can be expected that developers working on it would familiarize themselves with the new pattern, especially as it is the only one available for unsigned and native integers.
Reacted by Egor Bogatov, Levi Broderick, Joe4evr, bhood-zorus and John Tur
This could confuse people multi-targeting for .NET Standard because neither side is now a superset in IntelliSense. The value of hiding also seems low, especially because developers will typically explore alternative overloads and the tuple overloads will show first.
Activity
Dotnet-GitSync-Bot commentedon Nov 17, 2020
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
tannergooding commentedon Jan 7, 2021
I've marked this
api-ready-for-reviewso that the design review team can decide if this is appropriate or not.terrajobst commentedon Jan 12, 2021
Video
This could confuse people multi-targeting for .NET Standard because neither side is now a superset in IntelliSense. The value of hiding also seems low, especially because developers will typically explore alternative overloads and the tuple overloads will show first.