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?

  • abhibeckert@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    5 months ago

    Here’s a tip on good documentation: try to write the documentation first. Use it as your planning process, to spec out exactly what you’re going to build.

    And any time you (or someone else) finds the documentation doesn’t match the code you wrote… that should usually be treated as a bug in the code. Don’t change the documentation, change the code to make them line up.