• balsoft@lemmy.ml
      link
      fedilink
      English
      arrow-up
      26
      ·
      edit-2
      1 day ago

      Documentation will always have to be actually written by the author(s) of the code (or at least someone who understands the code really well), because only the author knows the intent behind a certain function or API endpoint, and that’s what the documentation is for.

      LLMs don’t understand shit (sorry AI bros), they will sometimes produce accurate descriptions of the function code as written, but never the intent. Even if the LLM “wrote” the code, it doesn’t “understand” the real intent behind it, because it is just a poor mashup of code taken/stolen from someone else, which statistically fits the prompt.

      What LLMs could help with is generating short, human-readable descriptions of what is happening in a given function. This can potentially be helpful for debugging/modifying projects with poor documentation, naming, and function separation, so that instead of gleaning through multiple 2000-line C functions in a 100k SLOC file, you can kind of understand what it does quickly. I’ve used deepseek for this before, with mixed-to-positive results.

      But again, this would just be to speed up surface-level digging and not a replacement for actual documentation or good practices.

    • davidgro@lemmy.world
      link
      fedilink
      English
      arrow-up
      61
      ·
      1 day ago

      If you are genuinely asking:

      Because documentation should be accurate and comprehensive. LLMs can do neither.

    • Trilogy3452@lemmy.world
      link
      fedilink
      English
      arrow-up
      30
      ·
      1 day ago

      If you’re asking in general and not as a way to feed AI: it writes a ton of text unnecessarily. Ever seen generated PR descriptions? They just basically quote the diff without adding any value

    • lechekaflan@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 day ago

      Hell no. Programmers must not just only write code, of course they do have to write the documentation because it is their work and using LLMs only encourages laziness and potentially cause confusion. Why we had extensive business English classes asides from programming in C or Pascal for DOS.

    • cley_faye@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      1
      ·
      1 day ago

      When it gets to the point where it does work to produce usable documentation, without extraneous content, with no mistakes, can be checked quickly, and it is faster to generate + check than to write it, maybe. Assuming a stellar history of being correct from the tool.

      As it is right now, once you reach the point where you actually need proper documentation to be written to keep things maintainable, these tools have low accuracy, lots of issues, and using them takes longer than it takes a competent person to just write/update whatever needs to be.

    • muhyb@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      3
      ·
      1 day ago

      While it might actually be beneficial for certain cases, I think it’s a slippery slope.