| I agree with this statement a lot. Using Copilot saves you a lot of tedium if you are comfortable with the language already. If you are new to the language, then it might trip you up a bit (at least in its current incarnation). Here is an example where it helps. I tried to initiate a connection to a Mongodb server using Python. While i have used many databases before, I have never used Python and MongoDB together. So, i knew i would have to have some kind of MongoDB library, a connection Factory and a connection string. I could have googled all of these things. I did the following in VS Code using CoPilot.
def get_db(): """Initialise a MongoDB connection to a local database"""
It then automatically filled in the rest. db = getattr(g, '_database', None)
if db is None:
db = g._database =
MongoClient('mongodb://localhost:27017/') return db
Notice above, that it knew i was using a flask environment and added the line getattr.Why this is a productivity boost is that i did not have to alt-tab to a browser, search for "pythong mongodb tutorial example" and then type it out. I was able to do the whole thing from VS Code and since i use vsvim, i could do this without taking my fingers off of the keyboard. This is the next jump since autocompletion. I like it. |
Sure it may take a bit more time to get going, but then you'll get it right the first time and learn something along the way. Your copilot example is just another iteration of copy-and-paste some random snippet from StackOverflow in the hope that it will work, but without having seen its context, like from when is the post and what comments, good or bad, did it get.
I'd actually be pretty afraid of a codebase that is created like that.