Live data from Hacker News

The Good and the Limitations of Github Copilot

blog.hrithwik.me

41–50 of 144 posts

Re: The Good and the Limitations of Github Copilot

#41
post #7

If they are using my code anywhere I expect to be compensated.

If you read the license you put on your project (and/or the GitHub Terms of Service), you wouldn't expect that.

I accept google's and Facebooks terms, and I still don't expect to be tracked across the internet to pay for the services they give me. Basically: my expectation is that companies aren't behaving as badly as their terms allow them to.

Re: The Good and the Limitations of Github Copilot

#42

A fun issue I keep hitting with Github Copilot in Python is that it's a coin flip whether it will give me a Python 3-style print statement or a Python 2.7 style print statement.

This seems to be another side of the problem that it gives code that doesn't actually compile for the target language. They should have a check for that, that should be the baseline.

For me, it sounds like it's closer to dumb copy paste than a smart code generator. AlphaZero wouldn't play a chess move that was against the rules.

Re: The Good and the Limitations of Github Copilot

#43
post #7

If they are using my code anywhere I expect to be compensated.

If you read the license you put on your project (and/or the GitHub Terms of Service), you wouldn't expect that.

Being credited for your work is a form of compensation. Nearly all open source licenses require proper attribution. Github is just violating the open source licenses of nearly all people that posted their code to Github itself, which is a huge breach of trust.

Re: The Good and the Limitations of Github Copilot

#44
post #24

Is === really necessary for Javascript? Type checking seems like overkill?

a == !a There’s several values of a where that yields true (of the top of my head, a = '0' is one of them). Yes, you do need ===.

If someone doesn't understand this then here's why.

You need to learn the Six Falsey Things In JavaScript. Everything else when cast to boolean will be true. These six things are What and Why and When And How And Where and Who. Wait, no, that's a totally different list of six... anyways

false

undefined

null

NaN

0

"" (empty string)

That's it. Since '0' is neither when the negate operator casts it to boolean it'll become true. And then negating it becomes false. When doing a comparison between '0' and false, the standard says https://262.ecma-international.org/5.1/#sec-11.9.3

> If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).

ToNumber(false) is of course 0. So you are running '0' == 0 which is visibly true...

Re: The Good and the Limitations of Github Copilot

#45
post #33

I wonder how much worse or better simply automating a stackexchange search and pasting the results is...

Searching SO and converting the highest rated answer's code that doesn't syntax error to a Python module is about 150 LoC[0].

[0]: https://github.com/drathier/stack-overflow-import

Re: The Good and the Limitations of Github Copilot

#46

Earlier quoted context omitted.

Hey Chris I am the author. When i made the video I didn't really notice the code part of regex, since I am really new to regex but in the conclusion part of my video I did mention that most of the code is not efficient Your comment was a great learning . Thank you

This is exactly the problem. The regex issue isn’t that it’s not efficient, it’s that it’s wrong. Using this tool to generate code in a problem area you are not qualified to double-check and validate yourself is dangerous.

This seems a bit overblown. If someone’s using GitHub Copilot to write code in a place it could be dangerous without any kind of quality control, then the odd wrong regex flag is the least of their problems.

Re: The Good and the Limitations of Github Copilot

#49

> Can help you with Email Validation and API Calls It generates a nastily complex regular expression that is hopelessly wrong. Visible at https://www.youtube.com/watch?v=9Pw-Roo_duE&t=404 , here transcribed: /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/ For the local part, it requires [\w-\.]+, which excludes many valid characters like everyone’s favourite, +.…

This has been discussed at length several times before and the answer to why you use a regex like that to validate emails is because you aren't trying to validate against a standard, but against a subset of email formats. You want a "normal" simple email. No "+" domains etc. Because it doesn't matter if you annoy the 0.01% of your users that would be negatively affected by that, it's better to have their simple/canon…

How is it better to have "simple" emails?

Re: The Good and the Limitations of Github Copilot

#50
post #33

I wonder how much worse or better simply automating a stackexchange search and pasting the results is...

Searching SO and converting the highest rated answer's code that doesn't syntax error to a Python module is about 150 LoC[0]. [0]: https://github.com/drathier/stack-overflow-import

Mildly related: https://gkoberger.github.io/stacksort/
Post reply on HN