Re:Coping with Copilot
by matthewmacleod on Sunday August 21, 2022 @08:18AM
(#32539421)
I think if anything there is far too much thinking going on here, for the tiny example I copied from the window I literally already had open with the function I was working on.
For what it's worth, Copilot (correctly) inferred a loop variable called "detection", I imagine based on similar usage earlier in the function. And there is already a conditional in place to prevent invalid operations; if I remove it I see a new suggestion:
if len(filtered) > 0 {
This tool is far from perfect, but it very much sounds like you folks haven't used it. If that's the case, I would encourage you to research it like all tooling and draw some informed conclusions about it's applicability instead of making assumptions.
Both good examples of coding where you should be thinking instead, though.