Hacker News new | ask | show | jobs
by ItsBob 508 days ago
Anecdotal but here's how I described using the likes of Copilot to my sceptical colleagues (they were late to the party!):

It's like having a senior software dev over your shoulder. He knows pretty much everything about coding but he often comes to work drunk...

And that was the best analogy I could come up with: I think it's sped up my work enormously because I limit what it does, rather than let it loose... if that makes sense.

As an example, I was working on a C# project with a repository layer with a bunch of methods that just retrieved one or two values from the database, e.g. GetUsernameFromUserGuid, GetFirstnameFromUserGuid and so on. They each had a SQL query in them (I don't use ORM's...).

They weren't hard to write but there were quite a few of them.

Copilot learned after the first couple what I was doing so I only needed to type in "GetEmail" and it finished it off, (GetEmailAddressFromUserGuid) did the rest, including the SQL query and the style I used etc.

To me, that's where it shines!

Once you figure out where it works best and its limits, it's brilliant imo.

2 comments

To me, that’s either where a real editor shine (vim or emacs macro) or that’s when you need a metaprogramming capable language.
as a heavy user of vim motions and macros I'm thinking this is one reason I've not found AI code generation terribly useful.

Yes, it's good at boilerplate. But I've spent a long time getting good at vim macros and I'm also very good at generating boilerplate with a tiny number of keystrokes, quickly and without leaving my editor

...

or I could type a paragraph to an LLM and copy paste and then edit the parts it gets wrong? also I have to pay per token to do that?

no..

> or I could type a paragraph to an LLM and copy paste and then edit the parts it gets wrong?

I think there's something you're missing in their description. They're not asking a model to do anything, it's automatically running and then suggests what should come next.

Also in editors like cursor I can ask for a change directly in the editor and be presented with an inline diff to accept/reject.

I don’t know if you’re a vim user, but what makes people like vim is that once you master it, it’s not about typing and deleting characters. It’s about text manipulation, but live instead of typing an awk or sed script. It’s like when driving a car, you don’t think about each steps like watching the speedometer, verifying the exact pressure on the gas and brakes, and the angle of the steering wheel. You just have a global awareness and just drive it where you want to go.

It’s the same with Vim. I want something done and it is. I can barely remind how I did it, because it does not matter. Something like duplicate the current function, change the name of the parameter and update the query as well as some symbols, can be done quickly as soon as the plan to do so appears. And it’s mostly in automatic mode.

Yes, and this isn't the same.

It's a tradition to torture car analogies so let me do so, this is more like when you start to say goodbye to people at a party your car identifies the pattern and warms up, opens the door as you walk to it and then drives you home. If you sit and take the wheel to drive towards a hotel you booked nearby it spots that and starts doing that for you.

> Something like duplicate the current function, change the name of the parameter and update the query as well as some symbols, can be done quickly as soon as the plan to do so appears. And it’s mostly in automatic mode.

And with these things I might move the cursor to where I want to put the new function, and then it's just immediately suggested for me. One key press and it's done. Then it suggests the other two based on the type definition somewhere else.

Obviously this is the happy path.

Let's continue torturing the poor car. It'd be great if it works that way, but what I fears is when the AI chauffeur decide on a route that appears to go where I want, but instead it's a dead end, and you don't know the exact intersection for the correct path. Or it take a long sinuous dirt road ignoring the highway. Or it sends me off a cliff because it assumes it's piloting a plane. To manage those risks, you have to keep your hand on the steering wheel and know the route beforehand. In this case, I would prefer a GPS map and have something that is a bit less fragile.

I don't mind writing code, and if it become boilerplatey, it's a good time to rethink those abstractions or write a few functions. And there's snippets for shorter sections.

If that analogy is remotely accurate, it strikes me as a strictly negative value proposition for the tool.
Depends upon the user. Are you fast (and confident) at evaluating the output and discarding the bad suggestions? This is why I think using AI hurts some developers and helps others, and the usefulness is best for those who already have a good deal of experience.
I'm a senior developer so I spot the bullshit, like sometimes it makes up table names in the sql. Things like that.

It's definitely not fire-and-forget: more like extreme autocomplete (at least that's how I use it)

I don't ever use it for fire and forget, but I've been wondering how well that might work in small side projects where hidden bugs aren't a big concern. Like using a fire and forget to spin up a small javascript game. But never in production code that I might get a 2am Saturday incident call on.