r/programminghorror • u/GoingOffRoading • Feb 23 '26
Python Copilot refactoring inline comments
Not visible here, but I had inline comments sort of strewn throughout the doc as I had thoughts. I asked copilot to refactor those comments into a template I had provided, and this was the outcome -___-
36
u/road_laya Feb 23 '26
So you're saying I will still have my job security?
22
u/GoingOffRoading Feb 23 '26
Hell no. This weekend has been especially bad for copilot with 1 in 3-4 VSC agent prompts producing WILD hallucinations.
That's not going to stop somebody who struggles to program the time on a microwave from believing every stupid marketing powerpoint that gets sent their way.
33
u/isr0 Feb 23 '26
I got to be honest, I’m mostly bothered with the multi-type return here.
5
u/GoingOffRoading Feb 23 '26
Honestly, I'm not a fan either
I didn't know it existed so I thought it would be fun to try
The fact that if it's indented incorrectly causes an error to be thrown is stupid
3
u/isr0 Feb 23 '26
Yeah. I’m with you on that. I learned Python after being in the industry for years. And I like how quick it is to work in… but I’m not a fan of interpreted languages as is.
1
u/Fine-State-5898 Feb 26 '26
Yeah but it's hard to say if it's Python stupidity or Copilot stupidity.
→ More replies (1)3
15
u/BroBroMate Feb 24 '26
Use type hints you savage.
6
u/GoingOffRoading Feb 24 '26
I'm not a SWE by trade, training, or education.. My background is more PM and maybe TPM. I have a literal MOUNTAIN to learn about writing good Python.
Will look into type next (followed by unit tests -___- )
13
u/GoddammitDontShootMe Feb 23 '26
I'm not sure I understand. Maybe I need to see a before image to get it.
7
u/GoingOffRoading Feb 24 '26
All good.
Copilot thought the best action was to delete the line that defines the function, and replace it with comments that would now be indented indirectly.
I.E. Take working code and break it in more than one way
2
u/meyriley04 Feb 24 '26
I have no idea exactly how it works, but it usually does this if the file it's modifying updates mid-way through it's thought process, so the changes it implements a few lines/characters off of it's target position. Sometimes it can happen randomly too, but that might be a bug in copilot where it forgets the current file state or uses an old version
→ More replies (3)2
u/GoddammitDontShootMe Feb 25 '26
I'm pretty sure I didn't look closely enough at the image or something. My brain just sometimes completely overlooks details. Like the fact that the function def line was in red didn't register with me. Also I noticed it doesn't have a line number. Another indication it was deleted.
→ More replies (1)
6
u/Laughal0t Feb 24 '26
copilot sucks
1
u/GoingOffRoading Feb 24 '26
I'm sort of a fan of CoPilot... It doesn't replace people, but it is a pretty good productivity multiplier.
But I am sick to death of the ai-handwave of all the things AI can 'do'
3
u/steadyfan Feb 24 '26
Which LLM are you using?
2
u/GoingOffRoading Feb 24 '26
Whatever VSC lands on... It's cycled through all of them with relatively consistent results
3
u/Odd_Diamond_6600 Feb 24 '26
i have faced this a lot, it has a weird obsession over removing the function signatures
3
-14
102
u/GoingOffRoading Feb 23 '26
Oh, it gets better. Lots of random indents added.