Github Copilot
The application of AI to programming is huge now, with the existence of Github Copilot. I did not try it until now because of some verification issue with my previous college.
My CS friends use ChatGPT a lot to automatically generate the code for assignments. But that is not what I really need. I actually wants to involve in the generation process. Therefore, with me Github Copilot is way better than ChatGPT.
Github Copilot suggesting a whole function body for me
I have tried it for two coding assignments in the following way. I started by writing the docstring of the program first. Then I start with some few tokens like, class HashTable
, and it suggests the next few lines of code to complete a meaningful chunk of the program, in this case the private
and public
attributes and functions. That is best for me, because I want to verify the chunk first, modify something to my needs, and then continue generating the next one. Then when I typed the name of each function, it generates the contents of that function for me, almost perfectly correct! I only need to (1) verify the correctness of the code and (2) adapt some part of it to follow the specific specification I am following. Basically, it speeds up my programming x10.
Another great thing about this tool is that it lowkey introduces me to best practices instantly. Before, the only way to know about such knowledge is to either (1) wait for a teacher to correct me, which is expensive and slow, or to (2) follow some best practice tutorials, which is even more painful. Therefore, this tool is reeeeealy a game changer!
In terms of drawback, this tool sometimes makes me feel lazy and dependent. Sometimes it suggests 20 lines of code for free, but then I have the illusion that those code are written by me spending 5-10 minutes on. Therefore, there is a hesitance when I doubt the code and want to delete it. I guess it is similar to times when you don’t like/trust your coworker’s code though. So I guess I should think of this copilot as an actual coworker who cannot get sad.