Hacker News new | ask | show | jobs
by Waterluvian 1804 days ago
I hear you. But I see this as a horrible thing. Now people are going to be further absolved of responsibility of thinking through the problem first and then implementing it after.

Won’t this result in more junk code?

6 comments

This will then fold in on itself. The AI will start learning upon its own generated code, as there is no differentiator from what it wrote before. It has got a leg up from training on lots of human code, some brilliant written, some not, but eventually it will start dog fooding its own creations.

I am honestly pleased I am not using a Microsoft IDE and won't be part of all this crap. I have already started creating new projects on GitLab from now on.

AI may improve in many ways, but it will never reliably be able to infer what the user is wanting... because many users will not even be able to accurately define the problem.

It's a catch-22. If you can express accurately your need (the problem), then you're likely to be able to implement a solution to that need without an AI helper. In fact, you may find the AI helper to be a greater time cost than if you had just done it yourself. But if you are inexperienced such that you need the AI to help, then you probably aren't going to accurately expresss the need. And as such, you'll end up with "a solution", but perhaps to a problem that is different enough that there will be a net loss in time. Or worse, your AI "solution" ends up in production, and the damage comes later and at higher cost.

Not necessarily horrible but still, a bit frightening :).

I fear hordes of inexperienced developers, mindlessly clicking accept on the first suggestion, and then on the second, third, and so on, until one seems to work. And the more advanced tools like this get, the harder it'll be to review the code and make sure nothing's messed up.

I guess we'll have to think long and hard about what safeguards to build against these risks.

This is the issue I see. Developers will employ logic they don't understand, create systems they don't really understand, and large investments in time and finances will realize absolute failure. The risk of junk code and misunderstood logic grows exponentially with this type of tool. In the hands of a skilled Computer Scientist, it is a godsend, in the hands of the majority of us developers, it will create unmanageable complexity, stress and failure.
They mention this risk in the Codex paper, too

> One challenge researchers should consider is that as capabilities improve, it may become increasingly difficult to guard against “automation bias.”

Shouldn’t the question be whether it’s better or worse than copy-pasting random functions from StackOverflow you found when googling?
IMHO its worse because on StackOverflow, people can comment, upvote/downvote, add their own answers etc if the random code has issues or shortcomings or is a bad idea for whatever reason. With copilot, you have to trust it or trust that you can figure out if there are issues (which, if you're a beginner learning, you probably can't and according to that security articleq[1], in many cases even experienced programmers may not notice[2]). With StackOverflow, that's also the case, except you have many more eyes vetting it.

[1] https://gist.github.com/0xabad1dea/be18e11beb2e12433d93475d7...

[2] Two quotes from the article: "Oh, and they're both wrong." and "Both look plausibly correct at a glance". If the entire selling point is to write code faster, are we really going to give the code more than a glance? Personally, I find figuring out code I didn't write a lot harder than writing it from scratch, in most cases, because I understand my intent, while I don't understand the intent of others without some deep thinking.

Do people actually just copy paste? When I was much greener I never found that to work. The interface had to be thought about. And inevitably there’d be other details to modify.

If anything this just makes that easier to do wrongly. It wants to offer you code that’s not yours that you didn’t conceive of thoughtfully.

I’ve copy/pasted parts of code, but then I typically always link to the actual SO answer in the code. Sometimes it’s just the most pragmatic thing to do.
I have fixed some very broken code at work, and person who had originally added the code to the project just commented to the PR "I copied it from StackOverflow so it must be right". That person had architect title and I don't, so he must have been doing something right.
It isn’t really being sold as “are you the kind of developer who copies and pastes code you don’t understand from StackOverflow? The have we got an efficiency improvement for you!”
I can't say copy pasting has ever worked from me for stack overflow, unless it's something really rudimentary and I just want a quick example.
If anything it’ll make hiring harder. We’ll all get accused of gatekeeping for requiring candidates to really understand their output, because they don’t need to know all that junk! Just use copilot and tweak it until it seems to work!

(this what hiring in ML is like)

I see co-pilot more as an intelligent suggestion engine or tab complete on steroids versus something solving all of my problems or absolving one of thought. Does pair programming result in junk code?
> Does pair programming result in junk code?

No, but not because there's a second person writing code, rather because there's a second person to think about it and think through how it works and interacts with the rest of the system.

As I said in another comment, actually writing code is only a small part of my work as a programmer, with pair programming, there is someone else who can do all the other things with me. Copilot cannot help with those things, certainly not in its current form.

The problem with Copilot as a fancy tab completion is that it can generate quite complex code, and, if code reviews are anything to go by, understanding other people's badly documented code is usually harder than writing your own. If its non-trivial, there's a strong urge to just accept it without really understanding all the details, because it appears to work. Or to just get a shallow grasp of it before deciding its good enough. Copilot will not help here, if anything, it makes it worse if it generates subtly broken code that otherwise looks correct and is too complex to really scrutinize and understand.

A better approach, I think, would be if you write unit tests and Copilot were to take them as input and write code to pass them. At least then it would be grounded in tests.

Right now, it seems Copilot shines for boilerplate code, but is possibly a net negative for anything actually complex (which it will still happily attempt to generate without warning you). A disciplined programmer will likely benefit from Copilot, but I shudder to think about what code a lazy, overworked or too-beginner-to-spot-problems one might let slip through (based on this recent article about copilot: https://gist.github.com/0xabad1dea/be18e11beb2e12433d93475d7...)