Writing Code with Github Copilot and ChatGPT Together — I

Both ChatGPT and Github Copilot are supportive tools to enhance your coding but obviously, they have limitations. Though those limitations are not prohibitive enough for you to discard the value they bring to the table.

Berk Orbay
DataBulls

--

My primary criticism is that they are too eager to provide an answer for you that they do not know the meaning of “Sorry, I don’t have a good answer for you.”

Although I tried other stuff as well, I constrain this post to code writing. I mainly used Python and VS Code in my trials for cloud systems integration development (nothing fancy). In addition, I tried to learn different languages and topics but they are more from a (literally) laid-back position.

Warm-up: Learning New Things

I started toying with ChatGPT with some extrapolation on advanced topics like “How do you solve a linear programming problem in PyTorch? Can you give me example code?”. ChatGPT churned out some detailed code something resembling a deep reinforcement learning method. I haven’t tried them yet.

I also asked it to write some code in Julia for me. It did a decent job in my opinion, though I didn’t put it to test either. What I was looking for is some “smart tutoring” to flatten the initial learning curve when I try new models and languages.

Finally, I asked ChatGPT to write some boilerplate code for serving a Javascript web project with CSS and the whole directory structure. I asked questions such as “How can I integrate Tailwind CSS?”, “Is it possible to write the backend in Node?”, and “I want to serve it in a serverless framework.” They are complex frameworks but the task was elementary. Eventually, it worked with some tweaks.

Enter Github Copilot

Github Copilot is a development companion which completes your code or writes your entire functions given a prompt in the comments. The product is experimental (<1 year old memory serves), but it has already proven to be a slick tool.

Main difference from ChatGPT is you cannot have a conversation with it. Otherwise, if I’m not wrong, they both use OpenAI Codex as their main engine.

It takes some time to adjust yourself for writing with Copilot. Sometimes you wait for suggestions that never come or sometimes you get some unsolicited code and you add it with a wrong keystroke (you use tab to admit Copilot suggestions and it is a bit frustrating when you code in Python and add indentation).

The whole experience

When it is time to write some code that should work, unsurprisingly none of these tools create wonders. You will still need to rely on Google searches, Stackoverflow, and some archaic method called “actually reading the documentation”.

As a bonus, you can ask ChatGPT to convert code written in one language to another language. For instance, I am porting some Python functions to Node. So far so good.

Their main contribution is that they speed up your development if you are well-aligned with them. They also help you with the composure of your project. Occasionally they help you pass a hurdle, especially when you are dealing with some library you have little experience in.

The third time you see the “I apologize for the confusion” phrase is the moment when you understand ChatGPT is feeding you some bullshit.

So far I enjoyed these two tools more than I am annoyed with them. I don’t feel that they are indispensable in their current form but I see they hold great potential if they can be specialized and moderated better (which I think will happen in the future not far away).

Initially, I had the impression that I will learn things quicker by employing these two AI but seeing the diversions they cause warned me to be more cautious about them. Nevertheless, it is again a significantly larger step from GPT-3 than from GPT-2 to GPT-3. I am quite excited about the future and what that means for coding skills.

https://www.linkedin.com/in/berkorbay/

More…

--

--

Berk Orbay
DataBulls

Current main interests are #OR and #RL. You may reach me at Linkedin.