On Alexa, ChatGPT & AI Programming

Let me begin with a little story

On the day Donald Trump was formally arrested, I did what any sane person would do. I went out for a few beers.

After coming home, I popped a pizza in the oven, which took 13 minutes to cook. I have an Amazon Echo in the kitchen, so I said the words “Alexa – set a timer for 13 minutes”. Of course my comprehension skills weren’t great so I wasn’t sure if the confirmation timer was 13 minutes or 30 minutes, so quick as a flash I said “Alexa, reduce my timer by 1 minute”, before asking for how long was left.

Why? Well, if the timer was on 29 I’d hear “Twenty Nine”. If 12 minutes were left I’d hear “Twelve”. Easily to comprehend for my slightly sozzled celebrating a crap president being impeached.

Why am I telling you all this? Well I feel like it shows how my brain works to find a creative solutions to real world problems, something as a developer I do on a day to day basis. I’m not saying I’m the best developer in the world, but I’m pretty good.

Like most developers, I’ve been hit recently with the downturn in tech. Not as much as some, but I’ve felt it. Furthermore in the past six months we’ve seen the rise and rise of AI so I’ve been thinking – am I safe for a job? Or should I look to retrain?

What I think the future holds for developers

I don’t know what the future holds for developers, but I’d be silly if – as a luxury of being a business owner – I don’t diversify a little bit. I can’t remember who said it but I feel more secure as a business owner having 4 or 5 clients that cover the mortgage than working one place that does. It makes sense to look at other opportunities.

With that said, development is my bread and butter. Whether it’s my own site or clients, 5 days a week I come up to solutions to problems. Sure there are similarities, but nothing is ever quite the same. Is that safe?

I think so, and whilst I did have my heart sink when I saw the Tom Scott video about AI, I was reassured when WordPress said that Use of Code Generators must remain GPL compatible. In short, if you write a plugin to put onto the WordPress plugin repository, you must be sure where every line of code comes from. I’m sure with mine, because I wrote it, but there is no guarantee that AI code is. Mika Epstein in their post then ended with the cheery line:-

Robots won’t take our jobs yet.

This reassured me as you see, code does go wrong. I prefer if it didn’t, but things do go wrong. Part of my job is putting things right. People will use your code in ways you’re not expecting to, or view your code on a Commodore Amiga, or (like I discovered in Neverspoons recently) that searching for Llanfair¬≠pwllgwyngyll¬≠gogery¬≠chwyrn¬≠drobwll¬≠llan¬≠tysilio¬≠gogo¬≠goch causes crashes. It can take time to figure out what goes wrong, and part of the joy (if the 25 thread email chain is anything to go by) is to figure out what the route of the problem is. AI can solve the problem, but may not be able to diagnose why it’s a problem to begin with.

Those problems need the human touch, and familiarity with the code. Familiarity that doesn’t exist when somebody typed “Code a Facebook clone” in ChatGPT. Sure ChatGPT may write code. However it doesn’t come with the learned and community knowledge that comes with developing it

Where I do use AI

I do however use AI for my business and programming. No more than I use automated tools to build CSS files and minify JavaScripts, or Google problems that I have that end up on Stack Overflow . Developers should at least look to use it to generate code and data structures quickly.

To give you an example, this was something similar I used for a project recently. I needed the international dialling code of every EU country, stored in an array.

A graphic of Rhys Wynne asking ChatGPT for an PHP associative array with the dialing code of every EU country, and an ISO 3166 alpha 3 code as the key

It’s simple code, but for me to build would take at least half an hour. Maybe I’d find a quicker way to do it, but even just finding a table, extracting all the EU countries, and putting it into a format I’d use would take time, and also be prone to mistakes. This was 30 seconds for the AI to build, and quick for me to check and cross reference.

Furthermore, my knowledge as a developer using the words “key”, “value” and “associative array” meant the AI Bot was able to build it to spec quickly. Similarly to knowing how to Google and what to Google makes problems easy to solve.

The Developer/Client Relationship with AI

So I guess I’ll end with the fact that this is an open admission I use AI for my job to deliver results for clients. Not much, but occasionally. Some things a computer is better at doing than my easily distracted brain, but I believe in being honest with people. After all, my freelance face is literally named after me.

AI is here, but at least with Dwi’n Rhys, you do speak to a human.