31st of January 2024
Pair programming with AI - How AI has changed my work life
Explore the transformative impact of GitHub Co-Pilot and ChatGPT on software development. Learn how integrating AI tools like Cursor into the coding workflow can mimic pair programming, enhancing productivity and creativity in the digital realm.
As I embark on a long-haul flight from Madrid, Spain, to my family home in Whanganui, New Zealand—a journey covering half the globe and demanding over 30 hours door-to-door—I find myself in a unique position to reflect on the impact of modern development tools on my work. Accompanied by my wife and two-year-old daughter, this journey offers a rare moment of pause in my otherwise fast-paced professional life.
Upon opening my laptop to make progress on a new product, Vinoflow, I was confronted with a stark reminder of the limitations imposed by a lack of internet connectivity. This sudden disconnection from the digital tools that significantly enhance my programming efficiency led me to pivot towards writing this blog post.
GitHub Co-Pilot, introduced in late 2021, has been a game-changer for many developers, including myself. It functions as an advanced code completion tool, akin to predictive text on smartphones but tailored for coding, enhancing productivity significantly. Initially sceptical about its value, my perspective shifted as I observed respected figures in the programming community adopt and advocate for its use. These endorsements, coupled with a notable mention by the creator of Python, Guido van Rossum, on the Lex Fridman podcast convinced me of its utility. The efficiency gains I experienced upon integrating Co-Pilot into my workflow were immediate and profound, underscoring the tool's value for a relatively modest annual subscription.
The advent of ChatGPT marked another pivotal moment in the evolution of programming tools. Despite its potential to revolutionise the field, integrating it into my workflow presented challenges, particularly in terms of the fluidity of moving between coding and consulting the AI for assistance. The breakthrough came with the discovery of Cursor, a VSCode fork that seamlessly integrates ChatGPT, offering contextually aware assistance directly within the coding environment. This integration has effectively bridged the gap between tool and task, allowing for an uninterrupted focus that closely mimics the dynamics of pair programming with a highly skilled colleague.
Treating AI as a pair programming partner has significantly enriched my development process and is how I have described it to friends and colleagues. I find myself regularly inquiring if there's a more efficient way to approach a problem, often disagreeing with the AI's or prompting it for alternative solutions. This process extends to tasks such as refactoring existing code or abstracting complex logic into more manageable components. It's this interactive, iterative process that truly encapsulates the essence of pair programming, with the AI serving not merely as a tool but as a collaborator that pushes me to consider different perspectives and approaches, ultimately leading to more refined and effective code solutions. This approach has not only streamlined my workflow but also enhanced the quality of my programming, embodying the collaborative spirit of pair programming in a digital format.
A particularly illustrative example of the power of these tools came during a project involving the implementation of Stripe Checkout for a client. Despite my extensive experience with Stripe, this was my first encounter with their checkout system. The integration challenges were non trivial, encompassing a range of requirements from item listing to handling taxes and webhooks. Certainly, with using the incredible Stripe docs as I have done it the past would have resulted in a similar implementation however through the direct assistance of ChatGPT within Cursor, I was able to navigate these complexities and complete the integration in an impressively short timeframe without once needing to leave the development environment. This experience highlighted the profound impact that integrated AI assistance can have on development efficiency and effectiveness.
The journey of adapting to and integrating these AI tools into my development workflow underscores a broader trend in the technology sector. As we continue to push the boundaries of what is possible, embracing these innovations can lead to significant improvements in productivity, creativity, and the quality of our work. Next week I will write a detailed post about how I pair programme with AI. In fact, I need to do a Xero integration so maybe I will write a post about that experience.