-
Notifications
You must be signed in to change notification settings - Fork 31
Over-verbose variables like results.results #43
Comments
Interesting point. Do you have suggestions on how you'd improve the api? Verbosity in general comes with the benefit of being self documenting. I agree that results.results is redundant, but results also contains other information such as fetching status, last executed time stamp, etc. |
I do not have strong opinion on how to format results data. That's just my observation. An older sample code written by you is less verbose though: |
I think the intention of the two are different. The algolia library you pointed at seems to be a client to talk to their service. The goals of this SDK are to handle not only requests to the service, but also maintaining the state of the application, eg which results are loaded, which facets are selected, etc. The idea with this library is that a large number of the UI patterns for search are generic, but require lots of state management and additional code beyond what a standard SDK wrapper over an API would provide. This library has the goal of making common rich UI scenarios like checkbox and range faceting very easy to build UI against. Actually I see three sorts of JS SDKs:
I'm happy to have the feedback on the verbosity of the API. We can definitely look at making the signatures shorter, but we'll have to balance readability and the self-documenting nature of the current APIs. I'll be opening some issues over the next day or two to start a discussion on the API surface area. It would be great to have you participate in that discussion. |
I've already tried some examples and I've found these very verbose:
For example:
It looks like
System.Configuration.Configuration
from .NET and I think the JS users are not accustomed to such verbosityThe text was updated successfully, but these errors were encountered: