My programming habits must be very different from some people's, if the popularity of Github Copilot is anything to go on.
Maybe I need to give Copilot more of a chance? But the one time I tried to use it, it was so disruptive that I simply could not get anything done until I turned it off.
When I'm writing code, typing and deciding-what-to-type-next are all mixed together. Before I know exactly what a line ought to contain, I'll type out a subset of it that I feel relatively confident in, and that helps me concentrate on solving for the remaining piece.
Like, if I'm writing a list comprehension, I might first type out
[ for x in things]
and only then double back and figure out what the expression at the start should be. Or, if I'm writing a complicated condition, I might type out a relatively obvious part of it
if x is not None and
and then think about the remaining parts with this text securely in place.
It feels helpful to do this, like I'm narrowing down a search space. I type the obvious parts quickly and readily, and then pause, to think about the less-obvious parts.
But with Copilot on, the act of stopping gives Copilot a trigger to suggest a completion. Right at the moment where I need to sit and think carefully, it jumps in and messes up my carefully arranged thinking space!
I guess if its suggestions were always right, this wouldn't be a problem? Like, if it just filled in the "less obvious parts" for me, and I could just read them and verify that they're correct.
But it's nowhere near able to do that.
The main problem isn't even with its level of coding ability, but with the fact that it doesn't know what I'm doing, and I have no way to tell it. It sees the code I already have, but it doesn't know about the new stuff I'm trying to put there -- the feature I'm working on, or the bug I'm fixing.
It would be more useful if it could automate the "obvious parts" -- the parts where it currently does nothing, because I'm typing quickly. That is, if it would pre-fill stuff like
[ for x in things]
if x is not None and
Sometimes it does in fact do stuff like the second one... but only sometimes. And sometimes, even when it's guessing a short piece like `x is not None`, its guess is still wrong.
And then the other half of the time, it's Leeroy-Jenkinsing way out ahead of me, writing entire nested blocks of useless, irrelevant program logic. All because I typed `if`, or something, and then paused for a moment.