Re:Ask HN: Do you document LLM-generated code as such?
by CamperBob2 on Thursday March 07, 2024 @04:20PM
(#39634715)
Actually I am pretty careful about adding stackoverflow URLs to comments, not out of any sense of obligation but so I know where to look if I need further insight when debugging or reusing the code later. This habit has paid off more than once.
For LLM-generated code, I don't see much value in documenting where it came from, especially since it will be very exhaustively tested (and likely rewritten entirely) before it gets checked in, to an even greater extent than excerpts snagged from Stack Overflow. Also, a given prompt will rarely return exactly the same code twice, certainly not years later when I need to look back at it. It will make more sense to create a new query if/when that happens.
I don’t document things as “I learned this from stackoverflow” either, LLMs are very similar.