This commit is contained in:
Corbin Crutchley
2021-09-14 12:29:59 -07:00
parent c92e41d319
commit 0ec8be80be
3 changed files with 116 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@@ -1,5 +1,5 @@
---
{
{
title: "GitHub Copilot is Amazing - It Won't Replace Developers",
description: "",
published: '2021-05-30T22:12:03.284Z',
@@ -10,7 +10,7 @@
}
---
I recently touched on how [GitHub Copilot](https://copilot.github.com/), an AI-powered code generation tool from GitHub and OpenAI, [is going to shift the way well need to do interviews](). Copilot frankly is astonishing in its abilities to generate complex algorithm implementations from nothing more than a function name. This makes sense given it's training data of GitHub's publicly hosted community code ([a controversial decision](https://twitter.com/eevee/status/1410037309848752128)).
I recently touched on how [GitHub Copilot](https://copilot.github.com/), an AI-powered code generation tool from GitHub and OpenAI, [is going to shift the way well need to do interviews](/posts/github-copilot-breaks-bad-interviews/). Copilot frankly is astonishing in its abilities to generate complex algorithm implementations from nothing more than a function name. This makes sense given it's training data of GitHub's publicly hosted community code ([a controversial decision](https://twitter.com/eevee/status/1410037309848752128)).
Some have taken these advanced algorithm assessment capabilities as a warning sign that developers will soon be fully automated using tech similar to Copilot, Im not sold on that idea.
@@ -24,7 +24,9 @@ That said, not every engineer is at or needs to be at an architectural level. So
# Bugs
Even when assisted by a tool like Copilot, bugs are inevitable in any system. Even if your code is perfection itself captured in text, we still have to rely on others code in upstream dependencies. Knowing how to work through finding the root cause and solving a bug is integral to development. Oftentimes, I find myself spending more time debugging complex issues than building a significant portion of fresh code. Regardless of if you use the debugger or print statements (which, we all do at some point, be honest), Copilot isnt able to automate that process for you.
Even when assisted by a tool like Copilot, bugs are inevitable in any system. Even if your code is perfection itself captured in text, we still have to rely on others code in upstream dependencies. Knowing how to work through finding the root cause and solving a bug is integral to development. Oftentimes, I find myself spending more time debugging complex issues than building a significant portion of fresh code.
Regardless of if you use the debugger or print statements (which, we all do at some point, be honest), Copilot isnt able to automate that process for you.
# Refactors
@@ -45,33 +47,100 @@ This nuance brings another point against the concept of developers being fully a
Ideally, you shouldn't be allowing developers to push code directly to production on a regular basis. While there will always be emergency scenarios where this doesn't apply, it's dangerous to ignore the code review stage. This isn't to say that you shouldn't trust your developers, but we're only human after all. If [Google can make a single-character typo to wipe every ChromeOS laptop with a certain update installed](https://www.androidpolice.com/2021/07/20/a-new-chrome-os-91-update-is-breaking-chromebooks-like-a-bull-in-a-china-shop/), it's not impossible your team may make a similar mistake.
During this process of code review, your team may discover bugs
During this process of code review, your team may discover bugs, realize that an experience is impacted by planned implementation, or even point out a more optimized or easier-to-read implementation. Having this team environment allows for a more diverse pooled perspective on the code that's being contributed towards a codebase and results in a better product.
# GitHub Copilots Strengths
None of this is to say that Copilot as a tool isnt advantageous
None of this is to say that Copilot as a tool isnt advantageous. Copilot is often able to make suggestions that impress me. In particular, if I have a somewhat repetitive task or are simply exploring a commonly implemented function, Copilot can fill in the blanks for me with only the name.
All of these utils are generated with Copilot using only the function name as an argument passed in:
```javascript
const reverseString = str => {
return str.split('').reverse().join('');
}
const normalizePath = path => {
return path.replace(/\/+/g, '/');
}
const stripBOM = str => {
return str.replace(/^\uFEFF/, '');
}
const usageOfChar = (str, char) => {
return str.split(char).length - 1;
}
```
While there may be _faster_ implementations of some of these, they're undoubtedly extremely readable and maintainable - they're how I'd implement these functions myself!
```javascript
class Node {
constructor(data) {
this.data = data;
this.left = null;
this.right = null;
}
}
// Copilot suggested all of this without any help whatsoever
class BinarySearchTree {
constructor() {
this.root = null;
}
insert(data) {
if (!this.root) {
this.root = new Node(data);
} else {
this._insert(this.root, data);
}
}
```
This isn't all that was suggested by Copilot, however - [it generated a full implementation of a depth-first binary tree](https://github.com/CoderPad/github-copilot-interview-question/blob/main/questions/javascript/binary-depth-search.js)
While I wasn't a developer when traditional autocomplete tools (such as Intellisense) came into play of daily development, I'm certain there were arguments from some against using it as well.
It's important to remember that even GitHub isn't poising Copilot as a replacement to
@@ -91,6 +160,28 @@ https://clips.twitch.tv/TacitFitIcecreamTriHard-KgJCKYYIEPqxe4dQ
# Learning Tool
I recently saw a tweet
While I couldn't find that tweet again after searching for it later, it stuck out in my mind.
After all, when I am learning how to program something new, it's always been useful for me to see an implementation of how it's done elsewhere. I remember being in my first programming job as a Junior and learning so much simply by seeing how others in the team wrote similar code.
Now, my early career was somewhat formed by what I'd seen others do in codebases I was adjacent to. Because I was assigned tasks, the things I learned about tended to pertain specifically to those tasks. Further, I found it somewhat tricky to find . After all, [Google search is not kind to many symbols we use in programming](https://stackoverflow.com/a/3737197).
# Documentation
# Conclusion

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB