How We Boosted Productivity in Our Development Process
This is the second post in our Chatbot Chronicles series.
In our last post, I introduced how our development company used Chat-GPT to convert a Client Brief into a Quick MVP. Today, I'll focus on using Chat-GPT as a pair programmer.
What is Pair Programming?
Pair programming is a popular technique in software development where two programmers work together on the same codebase. It's been shown to improve code quality, reduce errors, and increase knowledge sharing among team members. Our team at Sauce do this often, although sometimes they can feel like they are getting half the work done at the same time, it has been proven false time and time again. Even so, sometimes it can be hard to find time with team members to pair with when you need it.
There are many different styles of Pair programming. One of the most common is the Driver-Navigator. The driver handles typing, navigating between files, and basic implementation. The navigator, on the other hand, looks at broader concerns and checks for mistakes.
Robot Navigate!
We have been experimenting with using Chat-GPT as a permanent navigator, always on call for developers to help fix bugs, look up docs, suggest refactors or just do some monotonous text parsing.
Here's how it works: When one team member is working on a piece of code and needs help, they can prompt Chat-GPT with a specific question or code snippet. Chat-GPT generates a response based on its understanding of the code, offering suggestions or alternative solutions. The team member can then incorporate the feedback into their work.
Here’s an example of asking the bot to refactor some react code into a reusable Button component.
Following this thread, I know that I’m going to want to control the color of this button. Let’s ask the bot to have a go.
As you can see, it did ok with the first attempt, but I spotted an issue with its solution. After feeding that back I was happy with its second attempt. The interaction between myself and the bot starts to flow like two developers pairing.
We've found that using Chat-GPT as a pair programmer has been a huge timesaver for us. Instead of scheduling time to pair, we can use Chat-GPT on an as-needed basis. It's also been helpful for us to get a fresh perspective on our code, as Chat-GPT is able to offer suggestions that we might not have thought of on our own. It also saves developers a lot of repetitive keyboard typing, a huge win for RSI!
Of course, Chat-GPT isn't a perfect substitute for a human pair programmer. It's not able to understand the context of our code as well as a human would, and it's not able to catch all errors. However, we've found that it's been a great tool to supplement our existing pair programming practices and increase our productivity.