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
In the current signature, if a value does not exist this results in an error. This is somewhat subjective, but I would consider the possibility that a value does not exist for a key to be part of normal operation versus an error case (e.g. not being able to connect to the underlying data source) and would like it to be explicitly represented in the type signature.
This is especially true today because the error case is just basically a string so it is not possible for the user to introspect on the error and determine whether the value didn't exist or there was a runtime exception in a principled way. It sounds like there are plans to build out the error case and if it was an enumeration that included the value not being found then it would allow users to handle the possibility of a value not existing.
However, that still leaves implementers of the interface now in an awkward position and I tend to think that representing the optionality explicitly is the better API.
Would you consider a change for this?
The text was updated successfully, but these errors were encountered:
The current signature of
get
is:I would have expected the signature to be:
In the current signature, if a value does not exist this results in an error. This is somewhat subjective, but I would consider the possibility that a value does not exist for a key to be part of normal operation versus an error case (e.g. not being able to connect to the underlying data source) and would like it to be explicitly represented in the type signature.
This is especially true today because the error case is just basically a string so it is not possible for the user to introspect on the error and determine whether the value didn't exist or there was a runtime exception in a principled way. It sounds like there are plans to build out the error case and if it was an enumeration that included the value not being found then it would allow users to handle the possibility of a value not existing.
However, that still leaves implementers of the interface now in an awkward position and I tend to think that representing the optionality explicitly is the better API.
Would you consider a change for this?
The text was updated successfully, but these errors were encountered: