Re:AI can write code like humans, bugs and all
by Jensson on Wednesday September 22, 2021 @03:28PM
(#28620666)
It is usually more work to verify that code is correct than to write correct code in the first place.
Edit: At least for me it isn't obvious at all that those snippets are correct.
Re:AI can write code like humans, bugs and all
by ctoth on Wednesday September 22, 2021 @03:33PM
(#28620735)
This is an abstract response to a concrete demonstration of usefulness. Of course, if I'm writing crypto code or something where I don't understand the domain well, relying on Copilot would be foolish. But for a well-defined problem like the one I faced, juggling tree representations and a little recursion, being able to specify what I wanted and have the machine generate the code was actively useful and did actively save time. Also, don't you read your code once you write it in the first place? IF you've written it, you know what you meant, and are more likely to read something you didn't even write there, whereas if you're checking over the shoulder of your computerized coworker who has no ego to get hurt, you can be as critical as you need to.
Re:AI can write code like humans, bugs and all
by Jensson on Wednesday September 22, 2021 @03:35PM
(#28620757)
It is fine if you like it and it helps you. I am just telling you my opinion. To me that doesn't look helpful.
Re:AI can write code like humans, bugs and all
by fghfghfghfghfgh on Wednesday September 22, 2021 @03:41PM
(#28620841)
> This is an abstract response to a concrete demonstration of usefulness.
Brilliantly articulated - thank you. I wonder if this is a generic pattern (like fallacies)?
Re:AI can write code like humans, bugs and all
by dr_zoidberg on Wednesday September 22, 2021 @03:44PM
(#28620874)
In my case, the act of writing the code is still a moment in which I'm thinking and analyizing my code, and I might notice if there's some error in my train of thought.
Obviously that is how _I_ type code, and not something that can generalize to how others work. So it's my preference to still think about my code before, and while, I write it.
Re:AI can write code like humans, bugs and all
by klyrs on Wednesday September 22, 2021 @03:40PM
(#28620827)
> Why so much hate for the tool?
Whose code did it copy and how is that code licensed?
Re:AI can write code like humans, bugs and all
by ctoth on Wednesday September 22, 2021 @03:45PM
(#28620885)
Since Codex sends your own surrounding code as context, I'm assuming, though have no way to check, that it picked up on the patterns from the other ASTNode classes. I somehow doubt someone wrote the precise same @logCall decorator and attached it to their toEstree methods on their own ASTNodes. This is one of the things I find valuable, you can give it lots of help just by deciding where you do the generation from, what code is in the context window.
Also, if we're gonna start saying that simple conceptual things like AST processing are licensed, this is a scary world where very little new code will get written.
Re:AI can write code like humans, bugs and all
by klyrs on Wednesday September 22, 2021 @07:11PM
(#28623236)
The fact that you can't know where the suggestion came from is problematic. That github added q_rsqrt to the profanity filter shows that they're papering over the issue without actually addressing the problem that copilot can quote code verbatim without letting you know where it's from.
convertList(node: MooASTNode): List {
And then it just spits out:
This isn't exactly difficult to write or reason about, but it did save me quite a bit of time to just dash out the code that converts the parse tree to an intermediate tree in an hour or so and then just quickly look over and make a couple corrections.It also helped making the ASTNodes, for instance:
export class If extends ASTNode {
resulted in:
}Again, this code is not gonna win any prizes, but it sure did save me a good chunk of time. Why so much hate for the tool?