Re:TLDR explains what a piece of code does
by Timpy on Thursday September 22, 2022 @08:26PM
(#32946420)
Fortunately for me, at my current job I don't see a lot of code that makes me say "what the hell is this even trying to do?" The most useful comments are the ones explaining limitations and why this implementation was chosen, or business rules that wouldn't be apparent in the code.
Re:TLDR explains what a piece of code does
by Izkata on Friday September 23, 2022 @09:11AM
(#32951432)
Summarized by the common advice "comments should explain the why, not the what/how".
Re:TLDR explains what a piece of code does
by dogcomplex on Thursday September 22, 2022 @09:21PM
(#32946849)
Seeing as how its knowledge base is pulled from similar code pulled from the internet, I'd find it very likely to get the reference and interpret that as the quake fast inverse square root. Same with general context/library stuff - though obviously that's conditional on the quality of its training data.
e.g. it would probably "understand" common devops/organization/OS/library stuff even if it's not part of the language it's presumably reading - just because other users probably left comments on those lines similarly - but it's not gonna necessarily understand your application-specific business logic beyond what's actually happening. Would need some very specific examples though (by definition lol). Even dumb stuff like interpreting "make the div spin around" from some CSS/JS would probably work, as someone somewhere probably coded that similarly.
Edit: just thinking, the canonical example would be something like the fast inverse square root from quake. Is it going to summarize or is it going to tell you
(It would be cool if it does work here, even if it does, when someone makes up a new thing like this, it couldn't possibly comprehend why it's being done)