Except for this first paragraph and my reaction at the end, the entire article below was written by Bing Copilot using the prompt: “Can you write me a 300 word article on using AI chatbots to assist writing VBA code?” I will note my reaction at the end of the article. The title was also written by AI, but I did append “Article written with AI: “.
In the ever-evolving landscape of technology, AI chatbots have emerged as powerful tools to assist developers in various tasks, including writing VBA (Visual Basic for Applications) code. These chatbots, powered by advanced AI models, can significantly enhance productivity and streamline the coding process.
1. Instant Code Generation and Suggestions
AI chatbots can generate VBA code snippets based on user input. For instance, if a developer needs to automate a task in Excel, they can describe the task to the chatbot, which will then provide relevant VBA code. This feature is particularly useful for beginners who may not be familiar with VBA syntax and functions. Additionally, chatbots can offer suggestions to optimize existing code, ensuring it runs more efficiently.
2. Debugging and Error Resolution
One of the most challenging aspects of coding is debugging. AI chatbots can assist by identifying errors in the code and suggesting possible fixes. By analyzing the code, chatbots can pinpoint syntax errors, logical flaws, and other issues that might be causing the code to malfunction. This not only saves time but also helps developers learn from their mistakes.
3. Learning and Skill Development
For those new to VBA, AI chatbots can serve as interactive tutors. They can explain complex concepts, provide examples, and guide users through the learning process. By asking questions and receiving instant feedback, developers can quickly grasp the fundamentals of VBA and advance to more complex topics.
4. Enhancing Collaboration
In a team setting, AI chatbots can facilitate collaboration by providing a shared platform for code review and discussion. Team members can query the chatbot for code suggestions, best practices, and troubleshooting tips, fostering a collaborative learning environment.
Conclusion
AI chatbots are transforming the way developers write and interact with VBA code. By offering instant code generation, debugging assistance, learning support, and enhancing collaboration, these intelligent tools are making coding more accessible and efficient for everyone. As AI technology continues to advance, the capabilities of chatbots will only expand, further revolutionizing the development process.
Jon’s reaction:
I have used the Bing Copilot and the free Chat-GPT3 chatbots in assisting me in the past. I have used #1 minimally. I did have AI create a function for me once to take the number of bytes in a file and return it in a human readable format using bytes, Kb, Mb, and Gb. It did a decent job, although it did not actually handle the case of less than 1,024 bytes correctly. I think I tried to get it to correct it a couple times before I finally just fixed it myself.
I have NOT had a good experience with AI helping with error detection or correction. Perhaps I’m not the best audience as I’m already pretty good at finding bugs, I think.
One way I have used AI is to give it a multi-line SQL statement and have it break it up into strings using line continuations and assigning it to a VBA variable. It did that reasonably well until getting to the limits of number of line continuations allowed.
AI does seem pretty positive about itself using the prompt I did.
What do you think about Copilot’s article?
I think AI chatbots are (currently) better at reading code than writing it.
The common assumption that AI chatbots are good for beginning programmers is wrong in my opinion. If anything, AI chatbots are *terrible* for beginning programmers because they rarely seem to achieve a 100% perfect solution. And it takes a truly seasoned developer to spot and fix the 5% that the chatbots get wrong.
Now, for a seasoned developer, not having to type out 95% of a procedure is a real time savings, especially if you already have a pretty good idea of how it should work (and take the time to guide the chatbot accordingly).
That’s why I say that AI chatbots make good code-writing interns and good code-reading mentors.
https://nolongerset.com/chatgpt-intern-mentor/