Super close up of a white and yellow daffodil

Coding x GPT: Do We Even Need To Chat With Machines?

Like a lot of folks, I am super interested in AI, but also plenty fearful. Part of it is worrying about my future employment, and part of it is wondering how much longer all this code I learned about is going to matter. I’m a super nerd for this stuff.

Before we got all obsessed with generative AI, the new shiny in software has been about better abstractions for common problems. Tools like React or Docker reduce the need for a lot of repetitive tasks. I’m a frameworks guy, I use WordPress, Laravel, Docker, React, etc. to reduce the complexity of all the different things I’m doing.

Generative AI has a similar appeal to me. I haven’t dropped everything for it, and don’t intend to. What I do now and am good at — writing code and writing about code — is fun, makes decent money and I don’t think its going anywhere any time soon. But I am building stuff with it — my AI writing plugin and other stuff — and thinking about what it does to coding, especially what I do.

https://twitter.com/dan_abramov/status/1640022734989139970

I Don’t Write Code In A Chat

Yes, like a lot of folks, I ask ChatGPT to help me with code. More often I use it to explain code. I’ve been teaching myself more Python recently and it’s super helpful. Asking ChatGPT to rewrite some JavaScript in Python or to explain syntax helps a lot.

Making images with generative AIs like Midjourney and Stable Diffusion is a cool hobby. But, Stable Diffusion is getting built-in into graphic design tools. Adobe’s new Firefly is a copyright-respecting image generator that they can intergrate into Creative Suite.

I’m not switching to an AI IDE, but I did add an AI to my IDE – I use GitHub Copilot in vsCode everyday. That and the magic camera focusing and image processing on my Pixel are examples of AI integrated into pre-existing tools to make them better.

BTW, I use ChatKit as a front-end for Chat GPT. Besides being a much better UI, it also lets you add URLs of pages, PDFs, videos, etc. to use as context.

Are We Going To Build With Black Boxes?

One big benefit of a tool like React and Docker is reproducibility. React lets me describe my expected outputs, given specific inputs to generate a UI. Same with Docker, but it’s outputting a computing machine. What’s unclear to me is if code generating AI will be similar.

Or, will it be more like the deep learning that powers algorithmic trading, computer vision in semi-autonomous cars, etc is a black box.

Is this what PHP would look like with an AI powered interpreter:

function wc_get_products( string $category, int $total ) : array {
  //prompt: query database for products in category, return as array
}

Today co-pilot writes a lot of my code, but I’m still editing and testing it. That process goes better for me and the machines when we are using frameworks like React — less places to go wrong and more training material.

Think about the difference between an instruction like “make a web page with a button that triggers an alert when clicked” vs “create a React component with a button that triggers an alert when clicked” like a real human person. Whether I am writing or reviewing this code, there is a lot less ambiguity in the second prompt. It tells me what to do and a lot of how to do it, in basically the same amount of words.

Or tokens, if we’re talking about a generative AI instead of a Josh.

Maybe GPT-2000 will output byte code from prompts, I dunno.

Do We Even Need To Chat With Machines?

I am in a few group chats that I interact with everyday. I am in some Discords with some incredibly interesting people. I am fairly obsessed with Twitter and Mastodon.

Maybe I’m biased because I know some of the languages that computers understand. Maybe I’m being elitist and everyone should be able to do that, without learning special skills.

Turing Test is a classic UI for AI, but it doesn’t have to be the only one.

That’s all some what true. But I guess my actual point is we all have this powerful new tool we can choose to use, but I question if it should be the thing, instead of one of the many ways we make our existing things better.

I think that reducing the problem space, what React and Docker do probably get more important, not less important.

Optimize For People Though

What worries me the most, to be honest though, is how quickly people want to antropomorphise this thing.

Doesn’t matter if we’re talking about AI or anything else computers do — the people who want a human remover are the ones that scare me.

Featured image by me, via WordPress Photos.

New eBook

Refactoring WordPress Plugins

The PHP Parts

 For experienced WordPress developers who are looking to improve the PHP in their plugins, use new modern best practices and adopt test-driven development.