News for hackers. Stuff that matters.
Re:40% of the code GitHub Copilot users check-in is AI gener... by sph on Wednesday March 15, 2023 @02:28AM (#35164634)
Aside: am I the only one here that is still writing code by hand and not using AI to autogenerate it?

Because it seems over the past couple years on HN everybody is making great use of Copilot and constantly talking about it, while honestly scaffolding boilerplate is the least of my problems, while thinking, designing and abstracting novel ideas into code is the hard part where AI would fall short and just waste my time.

I still do not get if I'm behind the times or just experienced enough (I've been programming for two decades) that I don't feel the need to use Copilot. It's a bit disconcerting because I feel I need to get out of pure programming work ASAP as everybody else is competing with me with Copilot and GPT and I am feeling an existential risk to my craft and livelihood.

Re:40% of the code GitHub Copilot users check-in is AI gener... by zarzavat on Wednesday March 15, 2023 @02:46AM (#35164749)
Copilot is way more than scaffolding boilerplate, it catches bugs as you are writing them.

For example you expect: x[i]

But copilot suggests: x[i+1]

…and you think, and you think, and then one of two things happens. Either you satisfy yourself that the answer is indeed x[i], or you accept x[i+1] and sheepishly thank Copilot for catching a bug today.

You could have copilot on in the background and never accept a suggestion, and it’s still a productivity enhancement.

Re:40% of the code GitHub Copilot users check-in is AI gener... by nathansherburn on Wednesday March 15, 2023 @03:00AM (#35164834)
I found during my preview months ago that it would often write bugs that took me longer to correct than if I had written it myself. Has it gotten better?

Also in the situation where it suggests x[i+1] and it's wrong, doesn't that annoy you?

In both cases I'm sure this is just temporary while LLMs get better. But my experience was they were _just_ a little too annoying last time I used them.

Re:40% of the code GitHub Copilot users check-in is AI gener... by bananapub on Wednesday March 15, 2023 @04:34AM (#35165435)
> Has it gotten better?

yes

Re:40% of the code GitHub Copilot users check-in is AI gener... by markasoftware on Wednesday March 15, 2023 @03:26PM (#35173466)
Indeed, it introduces subtle bugs related to indexing pretty often. At one point I had it autocomplete maybe 15 lines of code, and I trusted it because the code was all pretty easy and I had written a descriptive comment, which tends to help out Copilot a lot.

However, it introduced a very subtle bug where it used a loop counter `i` where it should have been indexing into an array like `arr[i]`, but it still typechecked and happened not to cause insane errors. Took a lot of time to track down later, and it's a bug I never would have written in myself.

Re:40% of the code GitHub Copilot users check-in is AI gener... by jaredcwhite on Wednesday March 15, 2023 @02:58AM (#35164822)
Indeed you are not. I've never used any generative AI tools when coding or otherwise, and continue to refuse to at this point in time.
Re:40% of the code GitHub Copilot users check-in is AI gener... by ashwagary on Wednesday March 15, 2023 @08:20AM (#35167143)
>I've never used any generative AI tools when coding or otherwise

I'm in the same boat but I must admit the temptation is increasing.

Re:40% of the code GitHub Copilot users check-in is AI gener... by adlpz on Wednesday March 15, 2023 @03:31PM (#35173528)
I understand not doing it, just because you didn't get around to try it, but, refusing? why? Moral reasons? Copyright worries?

It's just another tool. So I guess the good old "will never stop using emacs" kind of attitude applies here too?

Re:40% of the code GitHub Copilot users check-in is AI gener... by Zuiii on Thursday March 16, 2023 @11:01PM (#35192444)
I never relied on code-completion (not even copilot). I found that coworkers who do simply can't function without it. They simply find it very difficult or even impossible to remember more than a few API names, parameters, etc. I still remember the constant complaints in the early days of Rust when code completion was not available or would constantly break.

Relying on code-completion for coding or relying on google maps for navigation dims your ability to do these things. Given that copilot is a remote service that I do not control, I will not voluntarily tie my ability to write software to it.

Coilot is a conditional, unreliable, untrustworthy, ability-as-a-service. No thank you.

Re:40% of the code GitHub Copilot users check-in is AI gener... by tasuki on Wednesday March 15, 2023 @03:22AM (#35164979)
> thinking, designing and abstracting novel ideas into code is the hard part where AI would fall short and just waste my time

How can you be sure of that?

I know scientists who use ChatGPT to rewrite their text to be clearer. They've also used it to pose novel interesting questions about a situation.

On my side, I've found ChatGPT very helpful to explore/compare which library to use to solve my problem and show examples how that library is used.

It's also been very helpful lining up Haskell types and translating GHC error messages into English. Sure, those are non-creative tasks, but it's surprisingly good at them.

Re:40% of the code GitHub Copilot users check-in is AI gener... by worrycue on Wednesday March 15, 2023 @03:56AM (#35165199)
Can you trust it though?

It can’t really reason - it’s just very good at guessing the right answer if there are a lot of examples.

It also lies somewhat frequently.

If we have to double check its output, it kind of defeats the purpose - at least part of it - as the “cognitive burden” is still on us.

P.S. Not sure what you mean by “lining up” Haskell types … but don’t LSPs already give us clear information about the inferred types and do so with nigh zero chance of errors.

Re:40% of the code GitHub Copilot users check-in is AI gener... by tasuki on Wednesday March 15, 2023 @05:21AM (#35165720)
> Can you trust it though?

Yes of course.

Libraries: I look at the libraries it suggests, see if they have documentation or GitHub activity.

Lining up types: say you have a `List (Maybe a)` and require a `Maybe (List a)`. This is a simple example, of course real life is much more complicated. ChatGPT tells you. Can you trust it? Well did it make the compile error go away?

(Sure, I can think of three ways to turn a `List (Maybe a)` into `Maybe (List a)`. Only one will be what I want, but it's easy to tell whether ChatGPT gave me the one I wanted.)

Re:40% of the code GitHub Copilot users check-in is AI gener... by lionkor on Wednesday March 15, 2023 @06:08AM (#35165971)
No, you can't trust it. It will certainly write bugs, and the code will have other issues. Usually too subtle for you to see at first glance, like off-by-one errors, or uncovered edge cases.
Re:40% of the code GitHub Copilot users check-in is AI gener... by worrycue on Wednesday March 15, 2023 @07:52AM (#35166813)
I guess if you use it like Google for small nuggets of information you can easily fact check, it's fine.

Although might as well just use Google directly which will send you either to Stack Overflow or Reddit where there are comments discussing the issue with back and forth fleshing it out or to a bunch of tutorial sites where you can source opinions from each site.

edit: nevermind the attempt at your puzzle, my solution doesn't work.

Re:40% of the code GitHub Copilot users check-in is AI gener... by pbronez on Wednesday March 15, 2023 @08:12AM (#35167051)
My experience has been that generative AI gives you a useful layer of abstraction above direct search. It’s like having an intern Google stuff for you, check out some promising results, and send you an email summarizing what they found. They make mistakes, but are generally ok.

You wouldn’t actually have an intern do this because the delegation takes more time than doing it yourself. With GenerativeAI, it’s snappy.

Re:40% of the code GitHub Copilot users check-in is AI gener... by worrycue on Wednesday March 15, 2023 @08:38AM (#35167325)
Adds another thing that can go wrong though. It doesn't cite its sources either, does it? I have seen people ask it to explain but it's explanation can be wrong too ...
Re:40% of the code GitHub Copilot users check-in is AI gener... by tasuki on Wednesday March 15, 2023 @05:23AM (#35165739)
> Not sure what you mean by “lining up” Haskell types … but don’t LSPs already give us clear information about the inferred types and do so with nigh zero chance of errors.

I don't mean type inference but turning the present type a into the required type b. LSP don't do that.

Re:40% of the code GitHub Copilot users check-in is AI gener... by worrycue on Wednesday March 15, 2023 @07:47AM (#35166762)
Still learning Haskell, don't quite get what you are saying. But I will probably figure it out someday.
Re:40% of the code GitHub Copilot users check-in is AI gener... by ramblerman on Wednesday March 15, 2023 @03:51AM (#35165162)
> while thinking, designing and abstracting novel ideas into code is the hard part where AI would fall short and just waste my time.

So don't use it there :) But I'm curious what kind of coding you do that you never have to do any scaffolding, refactoring, or come across any element of repetitiveness.

That is where it shines imo. I find during those boring tasks it quite often just gets my intent, and I can say "yes actually that's exactly what I wanted".

Which allows me to get back to the business of "thinking, designing and abstracting novel ideas" quicker.

Re:40% of the code GitHub Copilot users check-in is AI gener... by sph on Wednesday March 15, 2023 @04:12AM (#35165283)
AI is not as foolproof as many want us to believe. In my mind it's like giving a less experienced and error-prone engineer the code I'm working on to refactor.

Perhaps it's because I've always been a lone wolf engineer, but I'd rather do it myself than giving quite an important task to someone less experienced than me, whether I'm writing something new (where I need to be at my best) or refactoring (where I still need to be sharp to understand why it was done a certain way to know how to improve)

AI would help with extracting code into a function, or writing yet another algorithm implementation, or wiring bog standard libraries (say, cURL), but that's like foreplay and lower effort work I enjoy doing as a break from the hard stuff.

And to clarify my comment about AI being an engineer with less experience than me, I'd rather be paired with an actual junior engineer, so at least I can mentor them and help them grow, than just having a machine do something that in some cases might be utterly inane, so I still have to waste time double checking its work, but totally powerless to teach and improve it.

Re:40% of the code GitHub Copilot users check-in is AI gener... by enlyth on Wednesday March 15, 2023 @05:21AM (#35165722)
It's not foolproof but it does guess a lot of what you had exactly in your mind, just hadn't typed down yet.

If I start "enum { North", I will gladly accept the ", East, South, West }" autocomplete from Copilot, and this kind of thing, in aggregate, saves hours of your time.

Re:40% of the code GitHub Copilot users check-in is AI gener... by TheUndead96 on Wednesday March 15, 2023 @05:35AM (#35165780)
This is my feeling exactly, it is a semantic auto-complete. Should/can it write your core business logic? Probably not, but there is a good chance it can infer and suggest logical patterns in implementation.
Re:40% of the code GitHub Copilot users check-in is AI gener... by KyeRussell on Wednesday March 15, 2023 @07:08AM (#35166412)
Again, you’ve basically foregone empiricism and think that the Internet needs your uninformed reckonings about the shortcoming of a technology that you seemingly haven’t had experience with.

It sounds like you’ve been at this for a while, are set in your ways, and are trying to justify it. We all get set in our ways, but stop trying to pass this off as something it’s not.

I’d respect using Copilot and deciding that it didn’t provide value, but all this umming and ahhing is not that.

Re:40% of the code GitHub Copilot users check-in is AI gener... by saurik on Wednesday March 15, 2023 @12:33PM (#35170836)
> In my mind it's like giving a less experienced and error-prone engineer the code I'm working on to refactor.

You have almost 20 years of professional experience on your resume and likely were coding before that; it is difficult for me to believe sometimes, but most programmers have nowhere near that level of experience as the field is constantly increasing in size and scope: when I was in college, Computer Science was one small major people could enter that had only momentarily become popular due to the Internet... now it makes up a third of all students at major institutions that I would have assumed should be doing more interesting research work :(.

Regardless, you (and I) look at this AI as an engineer that is much less experienced than we are, and which is mostly able to code in repetitive ways with a ton of boilerplate that it sometimes gets wrong anyway; but, I think, for a remarkable number of people--even ones on this forum, where I often want to assume everyone should be an expert but in fact a lot of people just got into doing this work last week--that AI actually already has more experience than they do (and, now that they are using it so heavily to do their job, maybe ever will) and thereby makes fewer mistakes.

I don't know what that feels like, but it is certainly a very different experience than we are having. Maybe in another year or two, we'll have that experience also: if the AI gets good enough to become your peer, maybe we will find it interesting to use (or maybe we will become so demoralized, having not been in the position of having to work in a team of people better than us for so long--and these AIs wouldn't even be people!!--that we give up on the art entirely). I mean, imagine for a moment what it would be like if you found yourself in awe of the AI and were learning from it... I think it explains a lot of the confusing excitement about this technology.

Re:40% of the code GitHub Copilot users check-in is AI gener... by actsasbuffoon on Wednesday March 15, 2023 @09:32AM (#35168061)
I love it for writing tests. It’s good at picking up patterns, so if I need a bunch of unit tests then I can usually write one test and let it write the rest based on the RSpec descriptions.

I recently had a ticket that required refactoring some code that used net::http from Ruby’s stdlib over to using the HTTP gem. The rewrite was pretty easy to do by hand, but we had a bunch of test cases and rewriting them proved to be a bit painful because the mocks required were quite different.

So I spent half an hour rewriting the first test case with the new shape of mocks. Then I commented out the remaining tests and the AI recognized what I was doing and rewrote the remaining test cases with the new mock structure in seconds.

I treat AI like a junior programmer. I don’t trust it to do the hard stuff, but it’s great for scenarios where I have already established the pattern and I just need someone with basic coding proficiency to apply that pattern to a large chunk of code. It’s amazing at doing the grunt work.

Re:40% of the code GitHub Copilot users check-in is AI gener... by KyeRussell on Wednesday March 15, 2023 @07:02AM (#35166354)
Weird flex or whatever dude. But all I’m hearing is that your anxiety has led you to a) refuse to look into a new piece of technology, b) hold incorrect views on it (like that it’s only useful for boilerplate code), c) look down on those that ARE using it, and d) pose that your incredible experience is why this wouldn’t be useful to you.

If you can’t find your drive to look at new things enough to even see if they’re worth digging more into, which you seemingly haven’t, then I think this speaks poorly of you as a developer.

Re:40% of the code GitHub Copilot users check-in is AI gener... by sph on Wednesday March 15, 2023 @07:17AM (#35166493)
I'm sorry, but I do not get why you're making it personal and attacking my worth as a developer because I am doubtful about what Copilot can do for me.

It is possible to disagree without being rude and insulting.

Re:40% of the code GitHub Copilot users check-in is AI gener... by parthianshotgun on Wednesday March 15, 2023 @08:49AM (#35167488)
I think you're speaking to a, most likely, young developer. Having dealt with many similar sentiments, a few more years usually smooths this out. I always wonder if tech work is good for certain personalities, it's quite easy to carry on with a misanthropic communication style and still succeed
Re:40% of the code GitHub Copilot users check-in is AI gener... by TomSwirly on Wednesday March 15, 2023 @10:13AM (#35168611)
Being polite to others costs nothing and makes this a better place for everyone.

Personal insults are particularly destructive to civilized discourse.

Re:40% of the code GitHub Copilot users check-in is AI gener... by arp242 on Wednesday March 15, 2023 @07:46AM (#35166748)
I tried it out, but didn't find it all that helpful. Maybe part of that is just getting used to it. I'm also worried about the long-term effects: I have a much better understanding of things if I write it myself. There's a kind of "practice" involved every time you write something (code, documentation, prose, music, anything) and I'm not so sure losing that is a good thing in the long run. Proof-read a thousand books probably won't make you a great author.
Re:40% of the code GitHub Copilot users check-in is AI gener... by powerapple on Wednesday March 15, 2023 @08:36AM (#35167303)
when designing, thinking, abstracting, we are actually not writing any code. I sometimes use a whiteboard for example, of course CoPilot cannot help. Once we have your designed, thought-through implementation in your head, while you are typing in an editor, CoPilot definitely can help you write code faster (or slower if the output is not exactly what you have in your mind). I see it is a productive positive product.
Re:40% of the code GitHub Copilot users check-in is AI gener... by JustSomeNobody on Wednesday March 15, 2023 @09:09AM (#35167764)
> CoPilot definitely can help you write code faster(or slower if the output is not exactly what you have in your mind). I see it is a productive positive product.

The actual act of writing code "faster" baffles me. Without tools like intellisense, etc.[0], I am perfectly able to write code as fast as I can type.

There's absolutely zero need for me to write faster.

[0]Intellisense, etc. tend to get in my way, so I turn it off.

Re:40% of the code GitHub Copilot users check-in is AI gener... by WastingMyTime89 on Wednesday March 15, 2023 @12:02PM (#35170390)
Intellisense is a godsend when you are working in a large code base using proprietary API with varying level of documentation. It's very good at filling in the full name of that pesky class or giving you a quick list of functions in that package for you to pick the one you want.
Re:40% of the code GitHub Copilot users check-in is AI gener... by figassis on Wednesday March 15, 2023 @10:03AM (#35168486)
I use it, for autocomplete. It’s great for creating the text for string constants, error messages, autocompleting if statements (which if variables are properly named, works great). Speeds up repetitive work but it’s not useful for actual problem solving.
Re:40% of the code GitHub Copilot users check-in is AI gener... by commondream on Wednesday March 15, 2023 @02:23PM (#35172533)
I tested it, the suggestions were fine but not so helpful to be worth the property theft risk, so I uninstalled it.

You are not alone.

Re:40% of the code GitHub Copilot users check-in is AI gener... by la64710 on Wednesday March 15, 2023 @04:57PM (#35174611)
It is great for starters but my experience it everything AI generates needs to be double and triple tested and almost always manually modified to do exactly what you want to do. The 40% number just seems to be a tall claim and unless the data is shared and verifiable I don’t really give a crap about these claims.
Re:40% of the code GitHub Copilot users check-in is AI gener... by marssaxman on Wednesday March 15, 2023 @05:04PM (#35174698)
I'm not worried. Automating our jobs away is part of what programmers do, and always has been, but somehow we never run out of work to do.

I have not yet grown curious enough about Copilot to try it out; it seems to solve a problem I don't really have, since my productivity is never limited by typing speed. As you say, thinking and designing is the hard part.

Re:40% of the code GitHub Copilot users check-in is AI gener... by flykespice on Thursday March 16, 2023 @08:45AM (#35181124)
I can't afford to use it but if I did, I would use it as moderate as possible.

I look forward on the future of AI assisted coding tools, it could make us more productive on generating part of codes that we don't care much about, while leaving us time to deal with code that we do, manually.