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
This is a follow up of #205 . While making the changes of adding NRT to the project, I found an interesting change we may want to make as well: the KeyAsync(int index) method and its related functions. Right now it returns string? (null if the index is out of range). Should we:
Keep it as it is right now (Javascript convention, a null is returned if the index is invalid).
Pros: Consistent with Javascript code. The result is returned as-is. No change is needed and no breaking change is introduced.
Cons: Developers are ended up with string? result which most of the time should not be null and a ! or ? operator or null check is needed.
We throw IndexOutOfRangeException like most C# methods if the index is out of bound.
Pros: Consistent with C# convention. Most of the time developers do not have to worry about a null value if their code is sound.
Cons: Extra null or bound check for every function call. This is a breaking change.
The text was updated successfully, but these errors were encountered:
This is a follow up of #205 . While making the changes of adding NRT to the project, I found an interesting change we may want to make as well: the
KeyAsync(int index)
method and its related functions. Right now it returnsstring?
(null if the index is out of range). Should we:null
is returned if theindex
is invalid).string?
result which most of the time should not benull
and a!
or?
operator or null check is needed.IndexOutOfRangeException
like most C# methods if the index is out of bound.null
value if their code is sound.The text was updated successfully, but these errors were encountered: