News for hackers. Stuff that matters.
Re:Copilot regurgitating Quake code, including sweary comments by onion2k on Friday July 02, 2021 @09:03AM (#27710956)
Stuff like Copilot makes programming worse and more difficult, not better and easier.

Copilot makes programming worse and more difficult if you're aiming for a specific set of coding values and style that Copilot doesn't generate (yet?). If Copilot generates the sort of code that you would write, and it does for a lot of people, then it's definitely no worse (or better) than copying something from SO.

The author of a declarative, functional C# framework likely has very different ideas to what code should be than some PHP developer just trying to do their day-to-day job. We shouldn't abandon tools like Copilot just because they don't work out at the more rigorous ends of the development spectrum.

Re:Copilot regurgitating Quake code, including sweary comments by serf on Friday July 02, 2021 @09:32AM (#27711268)
>If Copilot generates the sort of code that you would write, and it does for a lot of people, then it's definitely no worse (or better) than copying something from SO.

Disagree.

Most SO copy-paste must be integrated into your project -- maybe it expects different inputs, maybe it expects or works with different variables -- whatever, it must be partially modified to work with the existing code-base that you're working with.

Copilot does the integration tasks for you. When one might have had to read through the code from SO to understand it enough to integrate it, the person using Copilot need not even invest that much understanding.

Because of these workflow differences, it seems to me as if Copilot enables an even more low-quality workflow than offered by copy-pasting from SO and patching together multiple code-styles and paradigms while hoping for the best; Copilot does that without even the wisdom that an SO user might have that 'this is a bad idea.'

Re:Copilot regurgitating Quake code, including sweary comments by buu700 on Friday July 02, 2021 @10:05AM (#27711667)
I'm not firmly for or against the concept of Copilot, but it's fascinating to me that it will introduce an entirely new class of bugs. Rather than specific mistakes in certain blocks of code and edge case errors in handling certain inputs, now we're going to have lazy/overworked/junior developers getting complacent and committing code they haven't reviewed that isn't even close to their intent. Like you could have a backend method that was supposed to run a database query, but instead it sends the content of an arbitrary variable in a POST request to a third-party API or invokes a shell to run `rm -rf /`.
Re:Copilot regurgitating Quake code, including sweary comments by marcosdumay on Friday July 02, 2021 @12:09PM (#27713344)
To me, the most interesting aspect is the new class of supply chain security vulnerabilities it will create. How people will act to exploit or protect¹ against those will be very interesting.

1 - I don't expect "not using a tool that generates bad code" to be the top option.

Re:Copilot regurgitating Quake code, including sweary comments by nightpool on Friday July 02, 2021 @09:17AM (#27711108)
The arguments that the GP makes are not based on a specific style or value of coding. Instead, they're based on the simple truth that it is harder to understand code that somebody else wrote.

In some cases the benefits of doing so outweigh the costs (such as using a stack overflow answer that's stood the test of time for something you don't know how to do), but with Copilot you don't even get the benefit of upvotes, human intent, or crowdsourced peer review.

Re:Copilot regurgitating Quake code, including sweary comments by mimixco on Friday July 02, 2021 @10:26AM (#27711939)
I don't think they work out past trivial applications. Any non trivial app requires an understanding of a much larger part of the codebase than a tool like Copilot is looking at at any one time.

Copilot does not understand the code in toto and is therefore really useless for debugging (70% of all coding) and probably useless for anything other than very simple parts of an app.

Re:Copilot regurgitating Quake code, including sweary comments by onion2k on Friday July 02, 2021 @11:06AM (#27712460)
Any non trivial app requires an understanding of a much larger part of the codebase than a tool like Copilot is looking at at any one time.

I don't think that's important. Copilot, at least as it's been demo'd so far judging by the examples, is to help you write small, standalone functions. It shouldn't need to know about the rest of the application. Just as the functions that you write yourself shouldn't need to know about the rest of the application either.

If your functions need a broad understanding of the codebase as a whole how the heck do you write tests that don't fail the instant anything changes?

Re:Copilot regurgitating Quake code, including sweary comments by mimixco on Friday July 02, 2021 @12:09PM (#27713341)
The reality of code is that stuff breaks when connected to other stuff, as it eventually must be for real work to happen. There's no getting around that.

Since that's where the work of programming is, debugging connected applications (not writing fresh, unencumbered code, a rare luxury), a tool that offers no help for that is, well, not much help.