It’s generally claimed that reading other people’s code is harder than writing your own. I mean, everybody loves writing code on a greenfield project but hates maintenance of legacy code, right? So, why do people like these code generators? The only explanation I can see is that people use them and then don’t read the code. Which would be horrifying.
It is absolutely amazing for writing boilerplate code that is also context aware. It saves me hours of typing.
It's hard to explain if you've never tried it because you're ideologically opposed to it, but stop being close minded and try it out, I promise it's a great tool to assist your programming.
Good codebases don't need boilerplate to do basic stuff: in this sense, copilot is a patch over the real problem, which can be solved with better frameworks and more code reuse.
I tried copilot during the beta, and apart from the obvious legal licensing issues, I simply could not find a valid usecase for any of the codebases I usually work with.
At my day job, I spend more time thinking of better ways to do X, rather than writing boilerplate code :)
I disagree. Some amount of boilerplate is preferred versus abstracting everything. Boilerplate can be frustrating to write, and fiddly boilerplate absolutely should be abstracted, but in general it should makes the flow of logic easier to follow.
> At my day job, I spend more time thinking of better ways to do X, rather than writing boilerplate code :)
Not that you are suggesting otherwise, and I am being somewhat facetious, but oftentimes boilerplate is preferred to boiling the ocean.
I have found Copilot useful while writing compilers and virtual machines all the way up the chain to CSS grids and media queries.
Are you telling me there isn’t a fair bit of boilerplate in bog standard implementations of OP_ADD or in a grid layout with a sidebar and a footer?
The irony here is that the level of abstraction necessary to remove all boilerplate means that you’re removing the descriptive nature of the boilerplate and making your code difficult to understand.
Boilerplate isn’t necessarily a bad thing but sometimes it can be rather verbose and it is very nice to offload that typing to a tool.
At your job the boilerplate was probably written already and you can avoid it.
Not all jobs are on mature projects.
I get tired of highly subjective anecdotes being used as concrete truths.
You are not the center of reality as we don’t know there is one. So good on you for having a job where the boring work was already in place. Look how far you have come on your own leveraging past effort. So proud of you.
You're completely missing the point of copilot. It speeds up typing by 10% or more in highly organized codebases. Strong codebases synergize with copilot, they don't compete.
10%+ speedup is a huge, obvious win. Anything that increases my productivity is good.
I am curious about the hours of typing thing. I don't normally need much boilerplate, so I normally just type things. If I do need boilerplate, I yank the boilerplate into a buffer and put it into the file I am working on. Yet I feel like the overall time spent doing this is incredibly slight.
I feel like it's possible some time could be shaved off somewhere there, but this all happens very quickly and it's not an area where optimization would improve things much overall. For this to amount to literal hours of typing, I think I would need to be either very much slower at typing, writing an immensely large volume of boilerplate, or working over many many years. Typing stuff is essentially never a bottleneck for me.
It’s not always on target, but it’s usually pretty close and the suggestions are good.
No, it doesn’t write all of the code for me. But it does rapidly construct even quite complicated if/else statements that I was going to write anyways, just from knowing where I’m typing. Quite a great tool.
I was just revisiting an api call which it turns out needed pagination. I put a note in the docstring before I began and copilot just... rewrote the function to include pagination. Except for a couple of corrections to the json returned by the api (copilot could only guess), it just worked! I'm amazing by copilot and it frequently writes chunks of my code, especially shell scripts and docker files. A little worried that my job might be on the way out at some point!
I love it but it’s nowhere near the level of replacing anything but the lowest skill developers. The actual real skills involved with deciding what problems to solve, architecting and developing complex software would require general AI level AI, and at that point a *lot* of people are going to be out of jobs.
It sometimes completes whole functions for me, from which I just have to make minor corrections afterwards. Some of which would have required me to lookup syntax 2 or 3 times. So it saves a lot of time in that way.
I do find it's much better in some languages though. And probably especially with languages you're new in. It doesn't do much for me in PHP, but does a lot in JavaScript.
And it's scary how good it is for "autocomplete" sometimes. I've found it much more useful on our angular webside frontend rather than the c# backend.. but man on the angular/javascript side it really saves time.
I can't think of any good examples off the top of my head, but every few days I literally am wondering to myself "how did I now I wanted to do exactly that!"
I use them to quickly learn new languages or libraries. E.g., I’ve done only C++ for a few years and got rusty in other things. I used copilot to quickly learn how to create a Python Flask server, how to draw shapes on an HTML canvas with JavaScript, how to write common algorithms like “generate a random number in this range” without having to reach for pen and paper, etc. all without leaving my editor. It’s kind of like a much faster Google search for a StackOverflow result, and keeps you in the flow.
Disclosure: I work at Microsoft, opinion is my own.
I'm sorry, but this is an incredibly shallow analysis. You don't even know what CoPilot is, apparently, and yet you speak in these broad generalities that are misguided at best. It's the only explanation you can see because clearly you haven't looked...
It's good enough that I wouldn't really call it a code generator, and I wouldn't put it in a category with other tools due to the performance different from anything else like it.
Often, it creates code that follows the style of the surrounding environment.
Honestly at this point, the copyright concern seems either ignorant or paranoid to me. The program is interactive and generally only creates small chunks of code at a time. You can read and modify the code it generates (I always do). I only operate on it in digestible chunks, none of which are "original" enough to be considered copyright. Surely, you as a developer can easily say whether the code generated is just some non-copyrightable snippet (some simple BFS code) vs stolen code lifted off a codebase (weirdly specific implementations, fast invsqrt, comments that look like they were written for a different context, magic numbers, undiscovered algorithms).
I would argue that if you can't differentiate between meaningful IP and boilerplate algorithm implementations (with variable names conveniently matching the surrounding context), then you have a different problem.
Yesterday I implemented a BFS in about 30 seconds because copilot recognized the pattern and auto-completed. It took 5 seconds to autocomplete, and 25 seconds to read and fix one line that was wrong. That normally would have taken me 5-10 minutes to code + debug (the copilot code didn't have any errors, minus the 1 I easily found). The productivity gains are too good.
This is a bit off topic, but I am naturally excellent at reading other people's code. I can somehow factor in commit messages and see their style to determine if they didn't know X area very well, if it was a temporary hotfix, or if they intended to come back and fix this area up at a later time. It's like I'm sitting there with them while I read it.
Is there a job title where I can put this to use? I'm alright in general feature work, generally exceptional in bug fixes or finding exploits, and exceptional in code reviews. I always get stuck in leetcode tests of technical interviews though despite having like 8 years of experience.
I've found myself needing some snippet of code that has a very targeted function, and whenever I see something online that's close enough, I sometimes paste that in my code and then make the necessary adjustments. This pattern is common enough (at least in my workflow) that if I could just start writing in the editor and it did a decent job figuring out what I was going for (in much the same way as my google query), and then let me dive straight into adjusting it, that's kinda nice.
You know all the times you need to lookup syntax or how to do something on Stack Overflow or some other site? Copilot replaces about 80% of that. Speeds up that process a lot.
Hah, fair. Honestly, it's great. It's great in 2 ways:
1) When it's 100% correct, I smile, because it's often very clever, and as a programmer whose very existence is based on work elimination, when that amazing technological weapon is aimed at my own work needs as a developer, this is some Inception-level glee.
2) It's often wrong. Maybe like, 33% of the time? BUT when it's wrong (note that 95% right is still "wrong," so it's still very good), I smile, because it's often STILL clever, even in its wrongness, and this cleverness amuses me while working. For example, I use Elixir, which linguistically (but NOT semantically) is very similar to Ruby, so on occasion I've seen it make a Ruby-flavored suggestion to my Elixir. "Silly Copilot," I'd say smiling as I'd correct it (and probably teach it further).
So basically, it's made my day slightly more joyful, which is great. I already enjoy programming, so watching a program try to write my code ahead of me is absolutely fascinating.
Simple example of labor saving- I was doing some bash scripting and I wanted some constants for ANSI colors. Well I started writing them, and Copilot finished the whole damn table (with correct constant names, using the naming pattern I'd already established). And all the color codes were correct. This was wonderful! It's GREAT for language domains you're not hugely familiar with. Like, know how you have to often look something up working in a lesser-used language? Well in Copilot, you can just start writing a comment describing what you need or what the code will do, and 8 times out of 10 it will then spit the actual correct code out for you, it's just amazing.
Oh, tip: There's a keystroke combo that will advance through various suggestion possibilities. Often the first suggestion is not quite there, but another suggestion is.
By the way, the example snippet given to "echo a random number between 1 and 10" is incorrect, pedantically speaking. It's random, but not uniformly so. It's biased towards lower numbers (1-6).
But that is not how /dev/(u)random works and does not give U(255). Generally speaking, it gives some hash of some user/device activity, from these resources:
Just to be clear, cryptographic hashes and other outputs of cryptographic primitives are designed to be uniform random. If you find a detectable bias from uniform on the outputs of /dev/urandom then you should consider the underlying primitive (the ChaCha20 stream cipher, in the case of modern Linux urandom) to be broken.
If you sum the occurrences of numbers 1-6, you get 1051 + 1012 + 1042 + 983 + 1015 + 1042 = 6145. The expected count (if the numbers were uniformly random) is only 6000, on average. If you repeat your experiment, you will find that this sum is greater than 6000 more often than not.
`od -N 1 -An -i` reads one byte from stdin (urandom in this case) and prints it as a decimal string (with value between 0 and 255). The awk command receives that number and prints it back out modulo 10.
Yeah, an easy solution to all these things is “find a uniformly random source that outputs in a range larger but close to what you want and then try again if it’s outside your range.
I wonder if you could bundle it as a language server to make integrating it into editor workflows easy. It’s “basically” just the completion capability, right? Or maybe there’s something else to the interactions that make it not work nicely.
Speaking of copilot, when is GitHub going to support billing for it at the organization level? Right now I would have to do a monthly reimbursement request which is a pain.
I understand that the company should pay for Copilot in principle.
However, is paying $120 per year that much when it helps you in your at least mid-five-figures job? I would ask for the reimbursement if it was annual, but filling out a form to ask for $10 back every month seems a bit over the top. Maybe I'm a spendthrift?
Am I missing something here? Would you say I am being irresponsible with my money?
I just remembered to cancel my AMC membership. That one was definitely not helping me do my job faster, and I'm not particularly regretful of losing a few dollars.
> However, is paying $120 per year that much when it helps you in your at least mid-five-figures job? I would ask for the reimbursement if it was annual, but filling out a form to ask for $10 back every month seems a bit over the top. Maybe I'm a spendthrift?
It's a slippery slope. You can't start giving freebies to your bosses (who are almost certainly much wealthier than you are) or it'll never end, just like you can't ever pay blackmail
First of all. If I was the legal team of any company I'd tell developers to stay away from copilot, since the legal status is still undecided and microsoft has a disclaimer that any legal issues fall on the users (which is probably illegal but you'd have to sue microsoft to get it overturned).
Second… It's a work tool just like any other work tool, why should I buy it out of pocket? In the end it's to the advantage of the company if I'm faster at my job.
Now I'm thinking, precisely because it's not paid by the company but by the single user, in case there is legal action, the company might shift the blame on the developer. If they reimbursed they would have no way of claiming they weren't aware.
Are there any companies forbidding developers to use it?
If that was my role I'd totally forbid it, precisely for the reasons you indicated.
If a developer is paying on his own for it to work, who would have the legal responsibility in the end? The developer personally? Another good reason to stay away from it.
I see the concern here from a level perspective so I’d probably forbid it too just to be safe.
That being said…I think this line of thinking is probably mostly a nothing-burger at this point. My experience is that anything sufficiently complicated that Copilot outputs is likely to be somewhat wrong.
I’ve only really found it to be (quite) useful for speeding up small things like if statements, switches/matching, short documentation etc, which I don’t think you can copyright anyways.
I wonder to what degree we can expect customization options in the future to forbid any complex code from being generated, or to constrain Copilot to helping with specific whitelisted
Perhaps, extending that last thought, there’s an ideological argument to be made that code that is so simple an AI can generate it isn’t worthy of being protected under copyright law anyways. I don’t know.
I find documentation and examples of using copilot quite limited. Anyone have any good pointers? Specifically I’m interested in how you can tune copilot on a specific codebase or language.
One piece of info I was able to get out of copilot devs directly in their Q&A session was that it looks at other open tabs for completion context (the example they gave being header files in C/C++, commonly open alongside implementations).
I've taken to just prototyping things in giant, single files because Copilot at least has the entire program in it's buffer (I think) to give suggestions based on.
I'm using a slightly different method. Vimwiki diary and a code block runner (runs in another tmux window)... so it's doubling as a (markdown/html) documentation generator of all my work.
I'm actually enjoying it as it's providing a lot of context on the time and notes/discussion on every command I run. Also good for history searches as regular cli history ultimately relies on your own memory.
Still it feels like you need to already have paid your dues... (I'm 20+ years in...) .
Haha, this is great! Thank you for sharing! Though you definitely started it with that username and the subject.
My friends have been using warp.dev and claim that the AI autopilot has made them 10x as productive on the shell. I just lament that people who haven't suffered through learning shell primitives as a teenager are now as productive or more than me. In time, all our primitive skills fall to the machine. I love it.
>Our GPT-3 powered AI search will convert natural language into executable shell commands. It's like GitHub Copilot, but for the terminal.
First time I'm hearing about this. Looks pretty cool. I think I already have a pretty good grasp on CLI commands, but I'll give it a shot, especially since the other features also seem interesting.
Yeah, sounded great. I just downloaded it.. hit a login screen..?! Then I read the HN comments on this page from 5 months ago, and immediately uninstalled:
This is the “spell checkers cause bad spelling” fallacy.
People learn by being told they are wrong. When you use copilot you are constantly being given examples that challenge your intuition. Maybe copilot is wrong, maybe you are wrong, either you are learning more with it on than with it off. Countless programmers get stuck in a rut writing the same bad code over and over again because nobody tells them it’s wrong. And it doesn’t matter if you’ve been programming for 1 month or 20 years, we all have something to learn.
Spell checkers do cause bad spelling, though. My spelling was once excellent (literally spelling bee kid), and after years of spellcheck, it's not only a lot worse, but I also often use the wrong word because it passed spellcheck - either because the wrong word is spelled similarly to the right word, or because the right word isn't in the spellcheck dictionary so I assumed I was wrong.
I don't know how you can tell me that my spelling has actually improved, and that I'm learning something from spellcheck other than not to worry about spelling things correctly because the computer will do it.
edit: By the same reasoning, you could argue that people are better at remembering phone numbers now because their cellphones remind them of the numbers every time they make a call. It would be a vaguely plausible theory before cellphones were widespread, but obviously false with experience.
It would be cool if it could learn to recover from failures and try other approaches until it gets the job done, and in the end verify it was correct. The security implications are huge, though.
Yes, I have used it with languages like Bluespec and Lean v4, which have very little data (FOSS code on GitHub) for the model to work with.
It's nowhere near as accurate as it is when using Rust or TypeScript but it's still mostly "autocomplete, on steroids", just with fewer "oh shit" moments.
That's funny, right before I opened HN I had just figured out how to get GitHub Copilot running in VS Code on a remote SSH server. I'm really impressed with how easy it is to install the VS Code agent and run extensions on a remote server, it feels very seamless.
I can't wait until someone open sources a model that will really drive innovative in this space. I don't feel great about a company uploading unknown information from my filesystem as context.
Since copilot support has only been implemented for a few editors (vscode, nvim, ...), the OP works around it by starting a bash shell inside the nvim editor.
Once you get to "vimshell %", you could just run bash and disable the vim keybindings.
A less hacked together solution would probably be running nvim in the background, feeding it the content from the current terminal session, intercepting the copilot suggestions, and then returning them as terminal suggestions (I'd use `tmux send-keys` and `tmux read-pane` with some regex to get the copilot results). Even less hacked together would be to implement a bash plugin to send out the necessary copilot API requests.
(I stay away for obvious copyright reasons.)