Live data from Hacker News

Coding on Copilot: Data suggests downward pressure on code quality

gitclear.com

31–40 of 60 posts

Re: Coding on Copilot: Data suggests downward pressure on code quality

#31

Gee really? You mean generated code by some ML model means people get lazier and just cut/paste hallucinated code? Who would have thought?

I doubt AI is making anyone lazier and less worried about code quality, if they weren't already.

Maybe lazy is the wrong term, but less attentive apparently. There was the Ironies of Automation paper about this: https://ckrybus.com/static/papers/Bainbridge_1983_Automatica...

Re: Coding on Copilot: Data suggests downward pressure on code quality

#34

Gee really? You mean generated code by some ML model means people get lazier and just cut/paste hallucinated code? Who would have thought?

Actually if you read the study (I didn't want to give them my email either) you'll find that they can't tell generated code apart from any other code, and are just saying that code quality went down (per their metrics) in 2023. They assume it is because of Copilot. They do not demonstrate this.

Re: Coding on Copilot: Data suggests downward pressure on code quality

#35
Code reuse is not a virtue it's a tool. WET is a good way to write code anyway. And at the end of the day, programmers who don't know what they are really trying to accomplish are never going to write good code. AI will just help them write different bad code faster.

Re: Coding on Copilot: Data suggests downward pressure on code quality

#36
post #29

I've found that it's useful for explaining things to me, and barely anything else.

It's ok if you: 1) Tell it what you want 2) Then realize it messed up because you forgot to specify more details 3) Repeat 1) & 2) ~25-50 (maybe>100) times, with different restarts/contexts with a clear goal of style and performance in mind. 4) Make some minor adjustments on your own

Now you have that 6 line script you wanted.

Honestly it is still pretty useful though, as you can see 'your code in different clothing styles' in some sense, very quickly to choose the best/most performant option. You just have to know what that looks like before going in, and it helps make it 'tangible' quicker.

Re: Coding on Copilot: Data suggests downward pressure on code quality

#37
post #20
post #12

Earlier quoted context omitted.

The study shows a doubling in the rate at which tech debt code is produced and checked into the repo. Anecdotally, as a principal engineer, I’ve definitely noticed that new senior engineers on the team that say they are using chatgpt/copilot produce unprecedentedly bad code at unprecedented rates. It takes me 2-3x longer to unwind such crap than it would for me to write it from scratch. As we grow the team, this will…

I was going to ask, why aren't they running the code through unit tests if they're committing such shit code? Does it pass the tests, or is it just inefficient code?

First consider following: The problem with current LLMS they generate code which in addition to any obvious messiness have the tendency to look plausible even if wrong. I.e. the kind of bugs which are overlooked in reviews the most are also the kinds of bugs LLMS are most likely to have "accidentally learned as correct behaviour".

Then: Outside of some extra complex or absurdly simple case it is very often harder to write tests which truly and fully test your code then it is to write the code correct.

In my experience often correct code is a product of carefully written test (which still are in reality imperfect), static code analysis (can be the type system, or external tools) applied to carefully written code and a proper code review.

So if you bring both of it together you have:

- AI supported code which is likely to contain bugs which are really easy to overlook in reviews

- AI supported test code which is has the same issue, i.e. they have gaps which are really likely to overlook by reviewers.

- more code due to less reuse and it also sometimes being easier to generate instead of use a library leading to more code review needing to be done and in turn more time pressure and less quality review

so put together: more bugs which are hard to find with test which are more likely subtle pass even with bugs and less time for proper reviews

So does it pass the test? Yes, but it was AI written too so can it be trusted?

Re: Coding on Copilot: Data suggests downward pressure on code quality

#39

I think this is what's happening. Code production speed has increased. But the speed and efficiency of review and testing hasn't kept pace. Also, my current job limits the use of AI coding tools, because of the risk of our IP leaking out. To really be useful, there is a lot of context a programmer should be able to collate. Not all of it is going to be in the repo.

IMHO there is some form of crisis of "value production speed" for various programming things.

And AI gives you fast code production speed so it seems to be a fix.

But due to less structured code and code reuse it needs much more code for the same value produced. And it loves to produce the kind of bugs which are easy to pass reviews and tests (because this are the kind of bugs it most likely has as "correct" code in it's training data). Which means less time per-value for human code reviews and in turn lower quality results on many levels.

I originally hoped that with CS/SoftwareDev getting older and less explosive grows and Universities more realizing the (sometimes huge) gap between CS and SoftwareDev the industry would get a chance of consolidating tech and dev processes to fix that issue. But with the rise of LLMs this hope might be further away then it ever had been in the last 20 year.

Re: Coding on Copilot: Data suggests downward pressure on code quality

#40
post #34

Gee really? You mean generated code by some ML model means people get lazier and just cut/paste hallucinated code? Who would have thought?

Actually if you read the study (I didn't want to give them my email either) you'll find that they can't tell generated code apart from any other code, and are just saying that code quality went down (per their metrics) in 2023. They assume it is because of Copilot. They do not demonstrate this.

Indeed, it could be a number of reasons:

- Making code more accessible mean people with lower skills can contribute.

- Increased in productivity increased expectations for deadlines and so there is less time for quality.

- 2023 was a year with lower code quality on average for everybody.

- Easier code to produce meant more code produced, and maybe it dwarfed the absolute amount of quality code, giving this impression, while the relative amount didn't change but we don't have their way of measuring good code.

Etc

Post reply on HN