4 ms·
People who are downvoting this: please set up and use GitHub copilot once, maybe for some auxiliary thing not connected to your main task. It is not just a too
by fooker 4y ago
People who are downvoting this: please set up and use GitHub copilot once, maybe for some auxiliary thing not connected to your main task.
It is not just a tool for students to write assignments. In experienced hands it can easily double your productivity.
- applesauce004 4y agoI 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.
- fanagra32 4y agoAnd you will have no idea whether the solution it presents to you is idiomatic or recommended or contains some common critical flaw or is hopelessly outdated. How can you find out? Back to alt-tabbing to the browser. 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.
- throwthrowuknow 4y agoWatch the demos where they provide GPT-4 with an API for performing search queries and calculations. These tool integrations are the next step and they will include specialized ones for using language and library docs. They could also be given access to your favourite books on code style or have access to a linter that they could use to cleanup and format the code before presenting it. The model is capable of using these tools itself when it is set up with the right initial prompt. Even now Copilot is pretty good at copying your code style if there is enough code in the repo to start with.
- fooker 4y agoYou have no idea if the alternative code you would have written would have been idiomatic or had some critical flaw. We have 50+ years of software engineering wisdom to deal with these issues. Testing, Fuzzing, version control, code reviews, the whole gauntlet.
- macNchz 4y agoI mean... I certainly know which languages I can write idiomatic code in and which I cannot. I can't know that my code will be free of critical flaws, but I do understand the common sources of flaws and techniques to avoid them, and I'm quite confident I can build small features like this that simply aren't vulnerable to SQL injection, on the first try and without requiring fuzzers or code review: https://infosec.exchange/@malwaretech/110029899620668108 https://infosec.exchange/@malwaretech/110029899620668108
- fooker 4y agoYou don’t have to accept the suggestions as-is. It’s just code, you can edit it as much as you like. Getting a good idiomatic starting point is a great boost.
- jjeaff 4y agoI'm confident enough in most languages I write in to recognize correct code. But I am not usually so familiar that I can conjure the exact syntax for many specialized things I need. Copilot is just a much quicker way to get what I need without looking it up.