How AI Tools Reignited My Passion for Coding

April 24, 2023

As a software developer, I'm always looking for ways to enhance my workflow and become more productive. That's why I've started exploring AI tools, and I truly believe that in the near future, every software developer will be using them. AI is not at a point where it can replace developers, but it can certainly make us more efficient and effective. As a result, a Software Developer will not be replaced by AI but by a Software Developer who is able to harness the power of AI.

AI Tools I'm using

Github Copilot is an AI-powered code autocompletion tool that suggests code based on the context of what you're writing. It's built on OpenAI's Codex technology and integrated with Visual Studio Code, making it easily accessible to a wide range of developers. I use it regularly, and it has saved me a lot of time and effort by generating accurate code suggestions based on the context of my work.

ChatGPT, on the other hand, is a language model that can be used for a variety of tasks, including code generation, summarization, and translation. While it's not specifically designed for software development, I've found it to be a great tool for generating code snippets quickly and accurately. With ChatGPT, I can easily generate code for specific use cases by providing a prompt, and it quickly suggests code that fits the context.

It's worth noting that the field of AI tools for software development is constantly evolving, and new tools are being developed all the time. To stay up to date with the latest advancements, it's a good idea to try out different tools and see which ones work best for your specific needs. A comprehensive list of alternative tools to Github Copilot can be found by Gergely Orosz.

How I Use Github Copilot in My Workflow

I use Github Copilot mainly as an autocomplete tool, which is particularly helpful when writing code. Compared to other autocomplete tools out there, AI-powered ones like Copilot suggest complete functions, not just individual words. With Copilot, I can simply write a few words or lines, and it provides me with solid suggestions.

To get the most out of Copilot, it's essential to set up the correct shortcuts for showing the next and previous suggestions. This way, if the first suggestion isn't ideal, you can quickly iterate through other solutions. If you're not sure how to set up shortcuts in Visual Studio Code, you can easily search for them by typing "shortcuts" into the search bar and selecting "Keyboard Shortcuts." Some useful shortcuts for Copilot include:

How I Use ChatGPT Extensions and Prompts in My Workflow

While Github Copilot is fantastic for autocompletion, ChatGPT takes things a step further by enabling me to interact with code in many more ways than Copilot allows.

Numerous extensions for Visual Studio Code integrate ChatGPT seamlessly, and I am currently using the ChatGPT - Genie AI extension since it seems to be the most popular at the moment.

Genie Extension

This extension incorporates a chat window into VSC, and it provides many commands out of the box. You can highlight some code and right-click it to display the commands.

Genie Extension Commands

One feature I particularly like is the ability to add tests to code. Since I believe testing is critical, particularly with AI-generated code, this function makes my life so much simpler.

After selecting the code and choosing a prompt, the output is displayed on the left in a format that is already formatted for easy copying and pasting at the correct position. This saves a significant amount of time that would be necessary when using the ChatGPT UI.

Genie Extension Output Sidebar

I've personally discovered that custom ChatGPT prompts are especially useful for tasks like code review and code grading. For example, I can use a prompt to review code and provide suggestions for improvement, and ChatGPT will generate a well-formatted markdown file with my recommendations. Here is an example prompt:

Code Review Prompt

Review the given code. Think through how you would improve it. Provide suggestions. Help fix bugs and errors. Point out areas for improvement. Commend what was done well. Add your thoughts on anything you think is worth commenting on. Respond with a well-formatted markdown file that is organized into sections. Be sure to use code blocks.

Another way I use ChatGPT prompts is to draft technical software specifications. I can provide a description of what needs to be built, and ChatGPT will generate a step-by-step guide for building it, complete with code blocks. Here's an example prompt:

Code Spec prompt

I need you to draft a technical software spec for building the following: {{description}} Think through how you would build it step by step.

For more prompt ideas, check out McKayWrigley's Prompt repository. While they may take some time to get used to, they are well worth the investment in terms of time and effort.

Conclusion

Incorporating AI tools into my workflow as a software developer has been a game-changer for me. Not only have these tools saved me time and effort, but they've also enabled me to be more creative and efficient in my work. I no longer have to spend hours researching and writing code from scratch, and I can now focus on more high-level tasks that require human expertise. Overall, I believe that AI tools will continue to transform the way software developers work, and I'm excited to see what new developments will arise in the future.

So why not give it a try yourself and experiment with the various tools available, you may just discover a newfound love for coding!