Designing a developer friendly API client in Scala
Blog post from Algolia
The Algolia Scala API client is a 14th API client released earlier this year, designed to be as easy to use as possible for developers. The main goal was to leverage the language's strengths while being easy to use and productive from the start. To achieve this, the documentation should be clear and easy to write, with the same vocabulary used across all API clients. The Scala API client uses idioms and syntax of its programming language, but also aims for consistency in naming conventions. It features a fluent API that looks like English sentences, but has some limitations such as not supporting 0 parameter methods and reserved keywords. To address this, the API uses `object` to handle special cases and provides type safety through case objects. The client returns `Future[_]`, but users can specify their own `ExecutionContext`. However, it does not support a `Stream[_]` result type due to added dependencies. As of today, batch operations are simple but could be improved with less repetition in syntax. Developers' feedback and suggestions are welcome.