this post was submitted on 13 Feb 2024
65 points (93.3% liked)

Technology

59593 readers
3792 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] abhibeckert@lemmy.world 5 points 9 months ago* (last edited 9 months ago) (1 children)

// write a function to invert a string

That's not how I use it at all. I mean I started out doing that, but these days it's more like this (for anyone who hasn't used copilot, the grey italic text is the auto-generated code - tab to accept, or just type over it to ignore it):

Sure - I totally could have written the constructor. But it would have taken longer, and I probably would've made a few typos. And by the way it's way better than copying from Stack Overflow, because it knows your coding style, it knows what other classes/etc exist in your project, etc etc.

It's also pretty good at refactoring. You can tell it to refactor something to use a different coding pattern for example, and it'll write 30 lines of code then show you a git style diff.

Not to mention you can ask questions about your code now. Like "how has X been implemented in this 20 year old project I started working on today?" Or one I had the other day "I'm getting this error, what files might be causing that?" It gave me a list of 15 files and I was able to find it in a few minutes. The error had no context for me to figure it out.

[–] eager_eagle@lemmy.world 2 points 9 months ago* (last edited 9 months ago)

I second this. GH Copilot for coding is an amazing tool, not just for boilerplate, but to fill complementary logic, brainstorm test cases, rewriting and refactoring, reducing typos or "copy and paste" errors, documentation, prototyping code from a human-written description, and probably several other things at different levels of competence.

Makes me wonder what people that don't find it useful are trying to do with it. Sure you'll probably need or want to change some things, but that's miles ahead of having to write it from zero.

Hell, if you start declaring a function with a good name and good names + types for the arguments, it'll often write an implementation that is mostly correct using the rest of the file as context.