Andreas Häggström's blog

Will StackOverflow exist in 5 years?

Advent of code

Tis the season yet again to get a humbling experience from Advent of code. For those of you who don't know, advent of code is an advents calendar made by Eric Wastl where a new programming task is published daily between 1-24 of december. I am this year trying to solve it in Rust but that's not the main topic of this blog post.

OpenAI GPT-3

I noticed some posts like this one on the advent of code subreddit, in which users have utilized a new tool in order to solve the various puzzles.

The interesting thing about this is that they don't really solve the problems themselves, instead they utilize GPT-3 by OpenAI. This is an advanced ML-model which can intelligently respond to e.g chat messages. But people are using it to generate code in order to solve these online puzzles.

I opened up the GPT-3 chat service and prompted it with a raw copy-paste string from advent of code day 2022 day 1. In a matter of seconds the GPT-3 model responded with the following:

Image

A (almost) fully functional code snippet which solves the problem correctly. The only error in the code is that an empty line should be found with "\n" and not "". But it's not even an error, it's me who didn't specify the input correctly. What also surprises me is that not only does it output functioning python-code, it also gives a step-by-step approach walk through as well as documenting the code.

I continued to try some inputs to the model, to see what else it could do. I started of with something that I would see myself search for on StackOverflow. How to concatenate two pandas DataFrames.

Image Lo and behold, It gives two alternative approaches with code-snippets which directly answers the question.

Let's ask for a bit more interesting thing. Say you are a person who want's to create a website for your mitten-shop. You are OK at html but don't really know how to get started on the front page. Could you use GPT-3 to get yourself started with some sample code? Image Yup.

It might not be that much of a "get me started" file, but it captures the context quite well.

Finally, I wanted to check if it can help me get better at my Rust-skills. I thought that what if I can input functions that I've written and ask for feedback on the code. So, during Advent of Code 2022 day 7, I wrote a function to generate the folder-structure from the input string. I thought that it was kinda clumsy and a perfect candidate for testing GPT-3.

Image In response, we get a 5 point list of improvements for the code in aspect of efficiency. I am quite new at Rust and can't really judge whether or not all the points on the list are actually valid improvement suggestions. But at a first glance, they seem pretty legit.

So, this tool could actually be used in order to get "personalized" code improvement tools on once journey towards learning a programming language.

In conclusion, and to get to the title of this blog post, one could argue that we don't need StackOverflow in the same way anymore with tools like this. At least not in the way we use it today for question-answering. Might it be that the future of StackOverflow is more of a forum-style site where for discussions, rather than question answering?