AI: First steps / coding

You've got to start somewhere, right? Like any project or new tool, for me, most of the initial hurdle is "ok, so whats a good use case to try this out". It took a while for me to find some for AI tools, but once I got started, it opened up a lot.

Just got here? Part 2 is here.

One thing a friend of mine uses it for, which is pretty obvious, is an interactive search engine. He just has the ChatGPT app on his phone, opens it up, hits the microphone button and asks a question.

Yes, we were watching A Gentleman in Moscow

He has a pretty good bullshit detector for when it's hallucinating, and none of the answers are anything more than inquisitive questions, but it's remarkably good at it, and its nice to use.

For him, its basically what Siri, or Alexa, should have been, but failed at so, so badly. Hopefully Apple Intelligence will fix some of that, assuming they can do inference at iPhone scale.

For me, some of the first tools I used were the most basic. It always feels odd to me - being a code writing engineer - when something this transformative comes out and it doesn't involve (and gatekeep on) writing code for it.

That part is whats going to be seismic shift in software engineering. A lot of the useful parts don't require special knowledge, just being inquisitive and working out how to coax information out of the models.

Coding - Github Copilot

My first exposure was via Github's Copilot. At that point, Copilot was basically ChatGPT 3 (now 4-o) embedded into VSCode (or Webstorm in my case), acting as a super-intellisense.

Initially - until earlier this year (2024) - it felt very much like pair programming with an annoying pair who would. not. shut. up. but was also wrong 95% of the time. (It's got a lot better recently).

It totally broke my chain of thought and muscle memory of the IDE, so I had it turned off a lot. The addition of the Copilot Chat made quite a difference, especially if I was working in a language I wasn't totally familiar with (Swift, Kotlin). Since moving to the ChatGPT 4 model, it has become a lot better, so I need to give it another try.

Sadly, I don't get to write as much code as I did a few years ago... but thats another story.

There are also a lot more, better tools for this - again, if you're reading this more than about 200ms after I write it, the landscape will have moved.

Apparently Supermaven Pro is the shiz, tho I'm yet to try it (ask me in a week or 2). I've not even heard of it 2 weeks ago.

My only criteria for trying these out is:

  • Does it integrate into my IDE (Webstorm / IntelliJ). Most do. If not:
  • Does it integrate into VSCode, at least to try it out (EVERYTHING does, this is the defacto standard editor now)

I suck at SQL, but Claude doesn't

Outside of writing code, I've used Claude 3.5 for a lot of help with SQL statements. SQL was never my forte, and some of the newer and more advanced stuff explodes my brain.

One example, I was trying to work out how to do get just the latest row of a table, for a record in another table, and it was quite helpful:

I have the following SQL statement for postgres.

SQL 

```
select p.id, p.nhi, eh.enrolmentFormStorageKey, eh.created_at

from tend.tend_patients p
left outer join tend.tend_patient_enrolment_history eh on p.id = eh.patientId
where p.nhi in (
'XXX9031',
'NXX2672')
```

It will return multiple lines for a patient if they have multiple entries in enrolment history. How can I get one line per patient, but the most recent row from enrolment history

Now, Claude has NO idea of our data schema - just whats up there. And the response was... rather good.

I then iterated on the conversation - asked it more questions, added some more constraints - and I ended up with the right SQL statement for this job.

I also tried it later which resulted in a lateral cross join - something I'd not even heard of before - which also got the right data out for me.

So is this going to write a fully formed SQL statement that I can just run right away, 100% of the time? No. Does it do 99% of the heavy lifting for me? Absolutely, with almost no input and minimal context.

Speaking of Claude

This was done with the Claude Artifact feature, which I need to try out - it's a paid-for feature, everything else I've tried so far is free. Just asking the AI to make a SVG Pattern Builder... and ending up with the code to do it.

It still needs an operator to drive it, but that operator doesn't need detailed knowledge of React and Tailwind, tho it would help. Great for exploratory learning.

Honeycomb

At Tend we use Honeycomb as our observability and tracing platform. They have a single-box AI/NL box, which I've mostly ignored. Trying it out, I think I need to learn a bit how to make it use the global app prefix, but it gets there mostly.

I see this - and Honeycomb do too - as more a learning tool than something you are going to go to during an incident. It's fun to play with if nothing else.


Thats most of the engineering bits I've played with. Next time I'm going to explore some of the things I've used AI for which are not related just to software engineering. Arguably, those are actually more interesting, and more interesting to a wider audience too.

Nic Wise

Nic Wise

Auckland, NZ