8 ms·
I don't use them either. I've played around with ChatGPT and Copilot a little, and found that they often are subtly, but very confidently wrong in their output
by nibbleshifter 4y ago
I don't use them either.
I've played around with ChatGPT and Copilot a little, and found that they often are subtly, but very confidently wrong in their output when asked to perform a programming task.
Sure you could spend ages refining the prompt etc, but its going to be faster to just write the fucking code yourself in the first place most of the time.
Then there's the privacy/security concerns...
- imiric 4y agoI really doubt it would be faster to write code manually, even with the state of AI tools today. Even with very sophisticated keyboard macros and traditional autocompletion, someone using GPT would outperform anyone who doesn't. Think of the amount of boilerplate and tests you write, and tedious API documentation lookups you do daily; that all goes away with GPT. The amount of work to double check whether the generated code is valid, and fix it, is negligible compared to the alternative of writing it all manually. Of course, I'm saying this without actually having used it for programming, so I might be way off base, but the feedback from coworkers who rely on even the now basic GitHub Copilot is that it greatly improves their productivity. I'm envious, of course, but I'm not willing to sacrifice my privacy for that.
- fooker 4y agoPeople 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
- f6v 4y agoMy experience was always that most of my time isn’t deducted to writing code. Maybe 10%, the rest us thinking about how the code I write will fit into the existing architecture or accommodate future features.
- mlboss 4y agoIn very near future your IDE will send the whole codebase as context to LLMs. Then instead of thinking up all possibilities you can just ask. LLM will suggest multiple alternatives and you can select the best when and ask it to implement it.
- roflyear 4y agoDon't make stuff up. There is no indication that will happen.
- sd9 4y agoThis seems very plausible to me. The context window improved a lot between GPT-3.5 and GPT-4, and OpenAI clearly see value in increasing it further.
- roflyear 4y agoExplain how it improved. Yes, it has improved accuracy (test taking) but it still gets stuck in the same loops over and over: "response has issue A" -> point out issue A to GPT "response has issue B" -> point out issue B to GPT GPT replies with the response that had issue A ... This is not a tool that is going to be good at performing generic tasks. It just isn't.
- sd9 4y agoI said that the context window improved. I mean that it is larger. GPT-3.5 is 4k tokens, GPT-4 is 8k tokens (standard) or 32k tokens (only API access atm). This is the number of tokens that GPT-X can take into account when producing a response. Specifically, I was using this to support the statement "In very near future your IDE will send the whole codebase as context to LLMs." I'm not talking about loops or accuracy. https://platform.openai.com/docs/models https://platform.openai.com/docs/models
- re-thc 4y ago> I really doubt it would be faster to write code manually, Not faster or slower but at what quality? At least every time I've tried to ask GPT 3 & 4 to write anything it's always missing things or not even close to the optimal way that I have to look up the docs and fill in the gaps, which often takes just as long as starting from scratch. > now basic GitHub Copilot is that it greatly improves their productivity Perhaps it depends on what you're working on. If it's quick iterations that isn't that concerned about what code goes in and whether it's maintainable then sure. It's impressive but for now still has lots of gaps. However it is over confident and often misleading.
- politician 4y agoWhich language is it struggling with?
- jhugo 4y agoI've had similar experiences when testing it out with Rust, Java and Go. Once I got beyond basic stuff, very little of the output was of a quality that I would consider remotely acceptable, and the work to bring it up to standard was basically equivalent to just writing the code in the first place (which, come on, typing is not even the time-consuming part of engineering).
- jjeaff 4y agoIt makes sense that it wouldn't be very good at Go or Rust since both are rather rare languages in the open source world that copilot is trained on. When I did my first go project a few years ago, I had the hardest time finding even basic examples like how to parse a json string. Rust is even newer and less used. But java is the 3rd most popular language for GitHub projects so I would think it would do better with Java.
- jhugo 4y agoThe failure mode seemed similar in all three languages. If you were doing toy things, or writing boilerplate stuff, it did perfectly fine. If you were writing something that wasn't a slightly-modified copy of some code that already exists out there, it fell apart. I don't think the issue is the language in this case — Go and Rust are common enough, and it rarely had trouble with the syntax — I think it's that the model doesn't go very "deep", so it's able to reproduce common patterns with minor variations but is unable to conceptualise.
- jhugo 4y ago> Think of the amount of boilerplate and tests you write, and tedious API documentation lookups you do daily; that all goes away with GPT. At work we have really worked hard to minimise boilerplate and manually-written/repetitive tests, so I don't write much of that. Getting GPT to write it would certainly be worse: we would still have the deadweight of boilerplate/repetition even if we didn't have to write it, and some of it would be incorrect. Maybe this varies a lot by company — if you're often writing a lot of repetitive code, and for whatever reason you can't fix the deeper issues, then something like GPT/Copilot could be a godsend. About documentation lookups, I don't know if this varies by language, but I've had very little luck with using GPT for this. For the languages I use regularly, I can find anything I need in the documentation very rapidly. When I've tried to use GPT to answer the same questions, it occasionally gives completely wrong answers (wasting my time if I believe it), and almost always misses out some subtlety that turned out to be important. It just doesn't seem to be very good for this purpose yet.
- imiric 4y ago> At work we have really worked hard to minimise boilerplate and manually-written/repetitive tests, so I don't write much of that. There's boilerplate in any codebase, even if you make an effort to minimize it. There are always patterns, repeated code structure, CI and build tool configuration, etc. If nothing else, just being able to say "write a test for this function", which covers all code paths, mocking, fuzzing, etc., would be a huge timesaver, even if you have to end up fixing the code manually. From what I've seen, this is already possible with current tools; imagine how the accuracy will improve with future generations. Today it's not much different from reviewing code from a coworker, but soon you'll just be able to accept the changes with a quick overview, or right away.
- jhugo 4y agoThis may be highly dependent on problem domain or programming language (see the other article about GPT tending to hallucinate any time it is given problems that don't exist in its training set). My experience has mostly been that the output (including simple stuff like "test this function", though we generally avoid unit tests due to low benefit and high cost) is consistently so flawed that the time to fix it approaches the time to write it.
- plorkyeran 4y agoIf you eliminated 100% of my code typing time with perfect effectiveness I think that'd make me maybe 10% or 20% more productive? Turning ideas of what the code should be doing into code just isn't a bottleneck for me in the first place. Are there people who just add net 1000 lines of code to whatever they're working on every single day or something?
- imiric 4y agoI keep seeing this point made, but AI tools don't save you just typing time. They save you time you would previously use to lookup documentation, search the web and Stack Overflow answers. They save you time it takes to navigate and understand a codebase, write boilerplate code and tests, propose implementation suggestions, etc. Dismissing them on the basis that they just save you typing time is not seeing their full potential.
- plorkyeran 4y agoNavigating and understanding a codebase is the only one of those which would excite me, but it's also something I've never even someone propose using ChatGPT for. Do you have an example of what that would look like?
- imiric 4y agoThere have been a few announcements here just in the last week: - https://news.ycombinator.com/item?id=35236275 https://news.ycombinator.com/item?id=35236275 - https://news.ycombinator.com/item?id=35248704 https://news.ycombinator.com/item?id=35248704 - https://news.ycombinator.com/item?id=35228808 https://news.ycombinator.com/item?id=35228808 And this is with the GPT-4 limitation of 32k input tokens. Imagine what will be possible in the next generation that increases the context size.
- TheNicholasNick 4y agothere are people who code the whole thing in their head and have perfect recall of all language/api docs/references/syntax/features as that is how their brain works. ie they don't even type code until this step has occurred for them. I think that is a small percentage of the dev community, so for me and people that don't operate like that, these tools are a game changer as you point out. I don't take what ChatGPT says at face value, I've got 15years of experience I'm weighting results against as well... chatgpt's version of the above: Coding entirely in one's head is rare. Most developers need external resources, making development tools invaluable. While ChatGPT's input is valuable, it should be balanced against personal experience and expertise.
- safety1st 4y agoI've only toyed with ChatGPT, but what I like is that it knows about stuff I don't. I'm reasonably informed about the tools, practices etc. in my field, but I don't know everything, and it's been trained on all kinds of stuff I've never heard of. In practice the stuff it will suggest to me is sort of random, it may or may not be the best choice for the task at hand, but it's a form of discovery I didn't have previously. The fact that when it tells me about e.g. a new library it can also mock up some sample code that might or might not work is a pleasant bonus.
- roflyear 4y agoYes unless you understand the problem well it is hard to fix it. Might as well code it yourself. I suspect the people who find this amazing tech don't program much or are using this very differently than we are. Or program very differently than us.
- throwaway4aday 4y agoIf you share your prompts then we could help. The most generally applicable thing I can think of is that you have to drop your old habits from using search engines, those types of queries will not get you very far. You have to talk to it like you would talk to someone in your company Slack/Teams/whatever chat and explain what it is you're trying to do and what tools you want to use to do it. Then ask it to refine its answer by telling it what it got wrong or clarifying the request you made by adding more details. Also, always keep in mind that it is fundamentally a text completion engine. You can drastically alter the type of output you get by adding relative context up front. That can be anything from snippets of code to requests for it to write in the style of some famous person to even just a chunk of your own writing so it can get an idea of the style that you use.
- roflyear 4y agoI'm not talking about informational stuff.
- throwaway4aday 4y agoCool, if you don't want to talk about it that's ok. In that case I'd suggest looking up one of the various prompt libraries and learning from there.
- roflyear 4y agoI'm just not talking about trying to fish an accurate answer. I think you can do that. I'm talking about getting an answer about something that requires an interaction that gets the model to "understand" the problem (like you would a person) - which GPT can't do.
- evilduck 4y agoCopilot is a huge time and typing saver for manipulating data, richly autocompleting logging messages, mocking out objects and services in tests, etc. If you're only expecting it to solve your hard problem completely and from scratch entirely from a prompt that's probably not going to succeed, but I can't see how you're possibly faster typing 80-90 extra characters of a log statement than a Copilot user who just presses tab to get the same thing. Those little things add up to significant time savings over a week. Same for mocking services in a test, or manipulating lists of data or any number of things it autocompletes where you'd previously need to author a short script to perform or learn advanced vim movements and recording macros to emulate.
- circuit10 4y agoThen use it as autocomplete to write things you were going to put anyway but faster, it will still speed things up