Live data from Hacker News

GitHub Copilot available for JetBrains and Neovim

github.com

71–80 of 446 posts

Re: GitHub Copilot available for JetBrains and Neovim

#71
post #63

Still no way to opt your code out of this. Disgusting.

Legally, it needs to be opt-in in order to protect downstream consumers of code written by Copilot.

Copilot sometimes reproduces code verbatim. You can't use open source code except under the terms of the license. Authors whose code may be reproduced by Copilot need to grant a license to downstream consumers, and republishers of Copilot-generated code need to adhere to the terms of that license.

Copilot is inserting ticking time-bombs into its users' codebases.

Re: GitHub Copilot available for JetBrains and Neovim

#72
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

The example i usually give [1] in javascript is say you have function

    (x,y) => x + y
Orgs targeting code coverage write a test for 1,2 => 3 and get 100% coverage and then stop as there is no incentive to go further. They don't write tests for say

   (1,null)
   (null,null)
   ('x',1) 
   (NaN, Infinity) 
and so on.. these additional tests will improve coverage of scenarios and code coverage will not move.

I have seen projects where a test will have sequence of steps which trigger the code but the assertion is effectively true === true, or they will replicate the same function in the test instead of generating proper mock data or myriad different absurd testing approaches. This comes from twin pressure of showing coverage and having tests pass.

Coverage is also a challenge in code which uses AI/ML libraries or that use third party services. These really need statistical testing with large volume of diverse well maintained samples and results need statistical analysis for error rates not different from how manufacturing does it, I don't see that often. For code using face detection for example a single face getting detected or not is hardly an adequate test.

Finally, it is easier to improve coverage by testing simpler code than improve coverage/ refactor a function which has say 10 nested branches, so it is not uncommon to see 90% coverage and 10% of the most used / most error prone code poorly or not tested at all.

There are some methods to address these like mutation testing, do retros for failure of tests to capture production bugs, it is not easy to measure and coverage driven orgs will not see their metrics moving by doing these.

Well written test suites will also have good coverage, but not necessarily other way around. Developers who care and understand what they are doing and why they are doing it, will use coverage as only the first step to see where there are gaps in their tests.

Tests are also code that need peer reviewed and maintained, if the tests depend on implementation and constantly break or contains improper mocks or assert poorly. A lot of not well written tests is hindrance to development than aid it.

[1] Yes, most of these are not applicable in a strongly typed language, but it is far easier as a illustration .

Re: GitHub Copilot available for JetBrains and Neovim

#73
post #60

Earlier quoted context omitted.

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'); // C…

Why does it increment the count?

I assume that in its training, incrementing a counter in redis is common.

Re: GitHub Copilot available for JetBrains and Neovim

#74
I’ve been using this for weeks and it blooooows my mind. It comes up with crazy recommendations, just yesterday I wrote this big ass logic to do something, then I wanted to move that code to a function so I wrote the function name and I kid you not copilot suggested a one-liner that worked… the thing is so useful and I’m not writing simple code (writing cryptographic code). And when it’s not doing that at the very least it provides auto-completion to lists where a counter has to increase and things like that. It’s just baffling, I don’t think I’m that directly impacted by AI, or at least this is the first time where I’m like “wow, AI really is changing the world RIGHT NOW”. Half-joking: can’t wait for it to just write my code.

Also if this feature would be paid tomorrow, I think I would pay for it. It’s really noticeable when I don’t have copilot enabled now.

Oh and, autocompletion doesn’t work with markdown files because of markdown plugins I think? But this is another level of insanity: when I’m writing english it figures a lot of the sentences I want to write. Makes me question if I’m just a deterministic individual with no choice.

Re: GitHub Copilot available for JetBrains and Neovim

#75
post #18

Earlier quoted context omitted.

It may be desirable for boilerplate to be maximally painful if it forces our collective hands to cut down on boilerplate and innovate it away

That’s a good plan if your language isn’t Go. For us I think tools to wrangle boilerplate are a lot more feasible than actually eliminating it.

    if commentErr != nil {
        hn.Upvote("https://news.ycombinator.com/item?id=29017491")
    }

Re: GitHub Copilot available for JetBrains and Neovim

#76
Copilot is crazy. The other day, I was writing a Python function that would call a Wikipedia API. I pulled from the internet an example of a GET request, and pasted it as a comment in my code.

  # sample call: https://en.wikipedia.org/w/api.php?action=query&format=json&list=geosearch&gscoord=37.7891838%7C-122.4033522&gsradius=10000&gslimit=100
Then I defined a variable,

  base_url = "https://en.wikipedia.org/w/api.php?"
Then, like magic, Copilot suggested all the remaining keys that would go in the query params. It even knew which params were to be kept as-is, and which ones would come from my previous code:

  action = "query"  # action=query
  format = "json"  # or xml
  lat = str(latitude.value)  # 37.7891838
  lon = str(longitude.value)  # -122.4033522
  gscoord = lat + "%7C" + lon
  ...
  api_path = base_url + "action=" + action + "&format=" + format + ... + "&gscoord=" + gscoord
As a guy who gets easily distracted while programming, Copilot saves me a lot of time and keeps me engaged with my work. I can only imagine what it'll look like 10 years from now.

Re: GitHub Copilot available for JetBrains and Neovim

#77
post #63

Still no way to opt your code out of this. Disgusting.

This reaction is why we can’t have nice things :( after trying copilot I’m convinced that this kind of feature is going to bring the world to a next phase. Open source was part 1, this is part 2.

Re: GitHub Copilot available for JetBrains and Neovim

#79
I tried it on IntelliJ recently. The examples I tested blew my mind. Yet, I think there are two things that need to improve to get me to use it regularly (it will get there!):

- less than perfect import/types/var suggestions that LSP in typed languages would've made perfect suggestions for (e.g named import in go would use the package name instead).

- latency feels a bit high and my thoughts would get interrupted waiting for a suggestion to come.

For the former, I wonder hard feasible it would be to give structured suggestions to the LSPs that it would swap for correct var names and imports and such. Or test each suggestion with the LSP for error counts and offer the least erroring suggestion.

Re: GitHub Copilot available for JetBrains and Neovim

#80

I've been getting a lot more misses than hits with Github Copilot, even when writing elementary math or utility functions; but despite its error I am nevertheless astonished at its approximation of intent. Very eager to see Github Copilot catchup to some bright line of signal v noise.

I would say the reverse, I’m getting so many hits that I’m mindblown. And when it missed, I can generally still use that and fix the suggestion, as it’s faster.
Post reply on HN