Live data from Hacker News

GitHub Copilot available for JetBrains and Neovim

github.com

51–60 of 446 posts

Re: GitHub Copilot available for JetBrains and Neovim

#51
post #2

Can any users give their opinion on how it's helping their productivity? What problems are they finding, if any?

It's truly amazing, almost felt magical the first few autocomplete results I got.

There's the benefits that a lot of people mentioned, but to me the biggest benefit is I can avoid procrastination. Usually when I'm blocked on something I'll run a search in the browser, but very quickly I end up going off the trail and just browsing the web and losing a lot of time. Now when I'm blocked I simply type the comment of what I'm trying to do and the autocomplete suggestion is pretty damn good and unblocks me very quickly. More surprising of all, it somehow understands my code style by looking at the context.

Re: GitHub Copilot available for JetBrains and Neovim

#53
post #21

Earlier quoted context omitted.

If you're looking for test case generation there are already mature tools for that. I doubt anything generic could improve on those.

any suggestions for said tools?

QuickcCheck-type tools (generators for tests that know about the edge cases of a domain - e. g. for the domain of numbers considering things like 0, the infinities, various almost-and-just-over powers of two, NaN and mantissas for floats, etc.):

* QuickCheck: https://hackage.haskell.org/package/QuickCheck

* Hypothesis: https://hypothesis.readthedocs.io/en/latest/

* JUnit QuickCheck: https://github.com/pholser/junit-quickcheck

Fuzz testing tools (tools which mutate the inputs to a program in order to find interesting / failing states in that program). Generally paired with code coverage:

* American Fuzzy Lop (AFL): https://github.com/google/AFL

* JQF: https://github.com/rohanpadhye/JQF

Mutation / Fault based test tools (review your existing unit coverage and try to introduce changes to your _production_ code that none of your tests catch)

* PITest: https://pitest.org/

Re: GitHub Copilot available for JetBrains and Neovim

#54
I've been using Copilot in VS Code and it's been surprisingly useful. It makes suggestions pretty rarely, but when it does I accept about 50% of them. Generally these are few-line functions and it just gives me what I would have written after thinking about it a moment.

Re: GitHub Copilot available for JetBrains and Neovim

#56
post #29

How well can copilot write unit tests? This seems like an area where it could be really useful and actually improve software development practices.

Writing tests for the sake of coverage is already practically useless which is what a lot of orgs do, This could maybe generate such tests. However it doesn't materially impact quality now, so not much difference if automated. One of the main value props for writing meaningful unit tests, is it helps the developer think differently about the code he is writing tests for, and that improves quality of the code composit…

Why is that useless? Codebases I have worked on that had high code coverage requirements had very little bugs.

* It promotes actually looking at the code before considering it done

* It promotes refactoring

* It helps to prevent breaking changes for stuff that wasn't supposed to change

Re: GitHub Copilot available for JetBrains and Neovim

#57
I actually really like Copilot.

There tends to be a lot of repetitive code in the world. I primarily write JS, Py, and Rust. Sometimes, I might declare something like a function table, and Copilot will automatically fill in the class definition with everything I defined.

I'm not using Copilot to write new algorithms or solve library-specific problems, but it sure is next-level in picking up patterns in a file and predicting where you want to go next. Obviously, good code is succinct (not repetitive), but it sure is helpful when in that early prototyping stage. I admire it's ability to infer a correct assertion when writing Unit Tests - it made it much easier for me to write tests recently and helped me recognize a few bugs.

Re: GitHub Copilot available for JetBrains and Neovim

#58
post #56
post #29

Earlier quoted context omitted.

Writing tests for the sake of coverage is already practically useless which is what a lot of orgs do, This could maybe generate such tests. However it doesn't materially impact quality now, so not much difference if automated. One of the main value props for writing meaningful unit tests, is it helps the developer think differently about the code he is writing tests for, and that improves quality of the code composit…

Why is that useless? Codebases I have worked on that had high code coverage requirements had very little bugs. * It promotes actually looking at the code before considering it done * It promotes refactoring * It helps to prevent breaking changes for stuff that wasn't supposed to change

I feel the opposite of codebases where having high coverage has been a priority:

* The tests doesn't actually test functionality, edge cases etc, just that things doesn't crash in a happy-path.

* Any changes to an implementation breaks a test needlessly, because the test tests specifics of the implementation, not correctness. Thus it makes refactoring actually harder, since your test said you broke something, but you probably didn't, and now you have to double the work of writing a new test.

* In codebases for dynamic languages, most of what these tests end up catching is stuff a compiler would catch in a statically typed language.

Re: GitHub Copilot available for JetBrains and Neovim

#59
this has been "inevitable" for three decades now. The difference is, walled gardens making participation non-optional; commercial intent over "fairness"; elevating the trivial for the pleasure of management .. what could go wrong?!

overall, a new forms generator with a somewhat terrifying amount of horsepower.. zero trust of microsoft here, basically

Re: GitHub Copilot available for JetBrains and Neovim

#60

Earlier quoted context omitted.

It does the boring code for me. If I want to throw an exception if an object is null or undefined, Co-pilot will do the if and the exception throw using the right error class, and a more meaningful error message that what I usually came up with. If want to map some random technical data table to something useful in my programming language, I can copy paste the data from the documentation in pdf or html into a comment…

This is the kind of thing I would need to see in real time, because I simply can't believe that it does any of these things in a way that is reliable and doesn't involve having to search through and make sure it hasn't made any mistakes, taking just as much time as if you did it by hand.

Likewise skeptical, but I have been super impressed with it. I just got in to the technical preview, and worked through a specific task I needed to do (involving mongoose, a mongo aggregate query, a few loops, some date functions) and started by adding a comment above each line. It helped a lot actually, felt like a collab.

I'll reproduce a generic example I sent a friend.

Prompt:

    const redis = require('redis');

    // Create a redis client
Copilot suggested:

    const client = redis.createClient();
I accepted it and moved 2 lines down, prompt:

    // Get the current count from redis
Copilot suggested a start to the operation:

    client.get('count', (err, count) => {
I accepted it, and Copilot continued:

      if (err) {
        console.log(err);
        return;
      }

      // If there is no count, set it to 0
      if (!count) {
        count = 0;
      }

      // Increment the count
      count++;

      // Set the new count in redis
      client.set('count', count);
  
      // Log the new count
      console.log(count);
    }
Post reply on HN