ChatGPT Coding – I Did It, and Have No Regrets
I first learned to program in the 6th grade. Since then I’ve spent time as an IT Engineer and System Architect. Prior to joining Cisco, I worked with Perl, shell scripting, Aspect, Expect, Tcl/Tk and a few others I’ve forgotten. We started with Perl when I was at Cisco, then switched to Java. And of course the webapps we built leveraged SQL, HTML and JavaScript. Doing full-stack work and Sales Engineering over the span of a few decades I’ve evolved into quite the generalist. I’ve worked with Varnish Control Language (VCL), Go and several others to the list depending on what needed to be built. Afterall my dad taught me early on that “the right tool is half the job.”
I recently ran into a snag where the CRM I use for my different projects had a bug that wouldn’t let me set some default values when adding a new Contact. Either the values wouldn’t get saved, or the date format would change to one that didn’t work and just brought up an error. It is open source, and the support team basically told me to upgrade to the paid version. Besides this minor annoyance, I really didn’t need to add that expense. I also didn’t feel like diving into PHP. I’ve tinkered with it a bit when working on a WordPress plugin, but really didn’t feel like digging into this one to add debug code and figure out their issues.
There was an area where I wanted to also leverage some APIs for the data that was being entered into the CRM. That got me thinking that perhaps a Chrome extension would be the way to go. I could start with the basics, just get these three fields set and later extract content from other sites and add the API functionality. Now some of you that are deeper into this tech than I am already see a problem I’ll hit later, but I’ll save that for later too.
I’ll never pass of someone else’s work as my own, but have no qualms about using code I’m legally allowed to use with proper credit being given. And a good security review also of course! For example, I’m putting together a virtual marketing event that will involve playing a whack-a-mole game on a Raspberry Pi. Sure, I could create the game, but there is only so much time in the day. A quick search for “site:github.com python whackamole game” on Google found someone’s homework that had the MIT license attached to it. Perfect – I can use it as long as I give credit! It was 9 years old, and Python had evolved, so I had to make one or two minor updates to get it to work. I do need to Fork their code and check it back in with the fix, or do a Pull request. I’ll also be adapting it to work with 5 OLED screens and will see how well I can adapt it to let you decide how it is configured.
But I’m really digressing here. Well, maybe not. I tried the same thing to find some code on GitHub that would create a Chrome extension. One that would modify a specific text field. It took me a while, and what I found didn’t do what I expected. I’ve been using ChatGPT for a few things, but have been resisting asking it to code. My good friend Darrell DeCosta has told me about the different ways he has used it for coding. I figured it was time . . .
When using a Large Language Model (LLM), there is a correct way to prompt it. This gets you the best answer the soonest. Saves you time and also overall reduces load on the LLM. Since I was experimenting here, I thought I’d forgo “proper Prompt Engineering” and just start with as simple request.
More to come . . . watch for updates!