5 ms·
How are you guys using Copilot? I feel it’s a PITA and interferes in between everytime I try to use it. How do you use it properly?
by adityamwagh 2y ago
How are you guys using Copilot? I feel it’s a PITA and interferes in between everytime I try to use it. How do you use it properly?
- teruakohatu 2y agoMostly for boilerplate things like assigning a bunch of thing to a dictionary, it usually knows what I am thinking.
- NewJazz 2y agoHave you ever stopped to consider why you are writing code like that, and if it is necessary in the first place? I think if you are spamming a lot of code that looks like: thing = params.get('thing') thong = params.get('thong') ... thunk = params.get('thonk') then you probably aren't delivering a lot of value with your code. In fact that overly verbose code could be a liability because it has to be reviewed (possibly multiple times as people look over the code to see how values are getting assigned).
- teruakohatu 2y agoYes I have considered that, and I consider it every time I write code. When you start using LLMs you realise how really is boilerplate. Error checking, unit tests, if statements, loops, so much code is boilerplate not just badly written code.
- klibertp 2y agoTry not to write code like this in statically, nominally typed languages (Java, Kotlin, C++, etc.). Without a good compile-time metaprogramming, you're bound to need code like this sooner rather than later [EDIT: you still should try to minimize it; it shouldn't be the first solution you reach for, but it really is unavoidable in many cases]. It's a PITA, but that's just it is in those languages - and Copilot works pretty well as an ad hoc code-gen tool.
- NewJazz 2y agoMy employer is asking me to try out Copilot to see if it offers a lot of value. IMO about 90% of the time it is an annoying interruption that offers to help me write a few characters (which I could probably write faster if I wasn't being interrupted) or maybe a few lines at most. 5% of the time it offers downright incorrect suggestions, and about half of those suggestions are only subtly incorrect, so I have to be on-guard about anything I use it for. 5% of the time it offers suggestions that I didn't consider, but are definitely a positive contribution. E.g. checking input parameter validity. I've heard that one way to use it effectively is writing a detailed comment about what you want to do, then let it suggest the code. I personally don't like those style of comments, so I'd have to: - enable copilot if I have it disabled (I have a keymap for this in vim) - write the comment - carefully review that the suggestion is correct and complete - accept the suggestion, then go back up to delete the comment kinda inconvenient, but if I was blanking on a bunch of stdlib functions maybe it would help? But accepting the copilot suggestions doesn't add imports, whereas accepting language server suggestions often does (e.g. with gopls).
- NewJazz 2y agoSome examples of wrong suggestions... things like suggesting OpenIDConnectClientCredentialsFlow when the actual name of the class is just OpenIDConnectClientCredentials. Language servers will have the correct suggestion, and Copilot is just a bother and a hindrance in that case.
- mistrial9 2y ago> My employer is asking me to try out Copilot this says more about your employer than CoPilot ?
- NewJazz 2y agoWdym, the whole comment or just that statement? If you meant the statement, then yeah. I was just offering the context for my usage of copilot. Essentially a solution in search of an unstated problem.
- 2y ago
- esalman 2y agoI work somewhere where they actively encourage copilot, and I actually have some good use-cases. Most of the time it is just autocomplete on steroids. Scanning the suggestion and hitting tab is almost always faster especially if you have to write a lot of repetitive code. Generating useful documentation. I work a lot with legacy codebases. Oftentimes I use copilot to explain what a chunk of code is doing, or give it a requirement and see what it generates based on context. At this point I think working with a legacy codebase as a new maintainer would be a lot harder if I didn't have copilot.
- remus 2y ago> Most of the time it is just autocomplete on steroids. imo this is kinda underrated, I use it all the time and it's a real time saver for me. It seems to have a good recall for things you've been doing recently, so it'll make suggestions based on a method I just added or a variable I just declared. Another fun one I had recently was implementing elo ranking. I'd done some reading so knew what I was doing, but based on the function name and comment it generated the whole thing for me, including all the correct argument names and object properties. Watching it pop up line by line was very cool!
- jasonjmcghee 2y agoManual trigger via shortcut key made it a useful tool I reach for in certain contexts. Automatic not being useful was the least of the issue, it used crazy CPU, slowed down the IDE, and drained my battery too.
- poulpy123 2y agoI use it as auto completion, and ironically to discover/have an overview of librairies instead on trying to find the good source between all the AI generated slop websites that Google propose
- setopt 2y agoI find the best way to use it is the chat interface. In VSCode, I can e.g. have the cursor on a Matplotlib command, press Cmd-I to open Copilot Chat, and say “make this plot an inset in the top-right corner of the previous plot above” and it will do it. The other way that works OK is when drafting new code, I can write some comments about what I want to do and trigger Copilot via a keybinding to draft a first version of the code. It can be useful when working with new libraries since I often don’t know what functions to lookup in the documentation.