I’ve encountered this many times where I simply don’t understand the context and use of an API based of the API documentation unless I can find an example that already utilizes it in a working project. The first thing that comes to mind is Py Torch. I’ve tried to figure out how some API features work, or what they are doing in model loader code related to checkpoint caching but failed to contextualize. What harebrain details are obviously missing from someone who asks such a silly question?

  • Max-P@lemmy.max-p.me
    link
    fedilink
    arrow-up
    53
    arrow-down
    1
    ·
    5 days ago

    API documentation isn’t a tutorial, it’s there to tell you what the arguments are, what it does and what to expect as the output and just generally, what’s available.

    I actually have the opposite problem as you: it infuriates me when a project’s documentation is purely a bunch of examples and then you have to guess if you want to do anything out of the simple tutorial’s paved path. Tell me everything that’s available so I can piece together something for what I need, I don’t want that info on chapter 12 of the example of building a web store. I’ve been coding for nearly two decades now, I’m not going to follow a shopping cart tutorial just in the off chance that’s how you tell how the framework defines many to many relationships.

    I believe an ideal world has both covered: you need full API documentation that’s straight to the point, so experienced people know about all the options and functions available, but also a bunch of examples and a tutorial for those that are new and need to get started and generally learning how to use the library.

    Your case is probably a bit atypical as PyTorch and AI stuff in general is inherently pretty complex. It likely assumes you know your calculus and linear algebra and stuff like that so that’d make the API docs extra dense.

    • Lysergid@lemmy.ml
      link
      fedilink
      arrow-up
      8
      ·
      5 days ago

      Agree. I find “get started” usually is the best way to give an example of “entry point” to API. After that API documentation should get anyone covered for most of the cases. If API is big then it probably has primary and secondary set of features. Secondary then can be covered as tutorials.