Code Monkey home page Code Monkey logo

Comments (4)

Kestrer avatar Kestrer commented on August 11, 2024 1

I don't like option E, because if the user wants to call an endpoint that doesn't require the market parameter at best they'll have to choose a random dummy value (which adds unnecessary extra code) and at worst they'll get confused and spend time getting a proper value.

I think that approach F is too complex. Even if we had macros that made it easy to implement, it basically doubles the size of the library, it's not worth it.

Approach G is too limited; it doesn't allow for users to have different markets for different queries. We don't want to force the user to have multiple clients, ever.

Between options A and B I don't have a preference, they both work. I don't think it matters which one is chosen.

PS: what happened to options C and D?

from rspotify.

Kestrer avatar Kestrer commented on August 11, 2024 1

Ooh, the letters came from your blog post. I didn't realize that and got really confused why two letters were skipped :P.

from rspotify.

marioortizmanero avatar marioortizmanero commented on August 11, 2024

The thing with E is that if the endpoint doesn't need the parameter it doesn't have to be specified. Its value will only be used for endpoints that require it. But yeah, I'm skeptical about it as well.

C and D seemed too basic to me and not exactly what we want. Of course, they can also be discussed. The main issue is that we'd need to declare both a function and a struct, and the user would have to import both of them as well, and with so many endpoints and so little of them with the exact same parameters I'm not sure if it's the most appropiate choice.

from rspotify.

marioortizmanero avatar marioortizmanero commented on August 11, 2024

After working a bit on #201 and working with function signatures, I've come to the conclusion that using so many unnecessary generic parameters with Into<Option<T>> is a mess. If anything I'd go for the simplest; option A.

Once #201 is done we'll get rid of the majority of optional parameters anyway, since when using iterators limit or offset don't need to be passed, so this should be less of a problem. The wonderful part about iterators is that the user can just use .take() or .take_while(), which won't cause unnecessary requests and can work as a limit.

from rspotify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.