zlacker

[return to "GitHub Copilot available for JetBrains and Neovim"]
1. mewse+4T[view] [source] 2021-10-27 22:39:24
>>orph+(OP)
I’ve never understood the value proposition for Copilot.

In terms of difficulty, writing code is maybe on average a two out of ten.

On average, maintaining code you wrote recently is probably a three out of ten in terms of difficulty, and maintaining code somebody else wrote or code from a long time ago probably rises to around a five out of ten.

Debugging misbehaving code is probably a seven out of ten or higher.

GitHub Copilot is optimising the part of the process that was already the easiest, and makes the other parts harder because it moves you from the “I wrote this” path to the “somebody else wrote this” path.

Even during the initial write, it changes the writing process from programming (which is easy) to understanding somebody else’s code to ensure that it’s right before accepting the suggestion (which is much less easy). I just don’t understand how this is a net time/energy savings?

◧◩
2. sireat+572[view] [source] 2021-10-28 11:08:58
>>mewse+4T
I also fear that Copilot will be teaching anti-patterns.

Just tried something really simple: def is_palindrome

Copilot suggestion was

  def is_palindrome(word):
      if word == word[::-1]:
          return True
      else:
          return False
facepalm

So good for technically correct solution but still...

This is an anti-pattern I think in pretty much any language that I know of and something that about half of my beginning students try when they learn about branching..

UPDATE: more howlers along the same vein

  def haystack_contains_needle(haystack, needle):
      if needle in haystack:
          return True
      else:
          return False
◧◩◪
3. sireat+4T2[view] [source] 2021-10-28 16:02:11
>>sireat+572
UPDATE: The above howlers were in IntelliJ...

However in Visual Studio Code on a different computer, I got much better idiomatic suggestions.

such as

  def is_palindrome(word):
      return word == word[::-1]
Very puzzling.
[go to top]