ProgrammingWithAI

ThoughtStorms Wiki

There's already a page called ComputerAidedProgramming

But this page is more about my experience and thoughts using AI as a co-programmer.

Tl;dr : I am sold! I was born to write code this way! To have higher level conversations with the AI about architecture and interfaces etc. And to focus on inventing new ideas and trying to explain them to the AI in a mix of natural language and formal notation.

I love it.

Something I posted on LinkedIn this week

I've now been working with the CursorEditor for about 5 weeks.

And the whole experience is phenomenal. Having an AI able to read and make changes across multiple files in the code-base is almost as big a game changer for me as when I first started using ChatGPT for programming.

Someone asked me my thoughts yesterday, and I was able to put into words something that was a bit vague before. The two most important lessons from AI assisted coding? TestDrivenDevelopment and type systems.

The first doesn't surprise me. I've long believed in TTD in principle. Writing tests before writing the code to pass them is obviously the right approach. However in recent years I've slipped away from it for reasons of... frankly laziness and irresponsibility. Working with AI assist has pushed me back to it. TDD lets you move forward faster. AI lets you move forward faster. I can now ask the AI to make big changes and refactorings, and have them done in a very few minutes. A solid harness of tests allows me to trust those changes.

The second surprises me more, as I've never been a big fan of static types. (AgainstTyping) But here's an example: In my project I have to translate coordinates between 3 different spaces. If it were just me, I'd probably represent coordinates and their translations using floats. TBH I don't normally hit many problems, doing something like that.

But for some reason the AI was making heavy weather of it. Things were not drawn in the right place; and it looked like "confusion between which coordinates were used, where" was the cause. So I decided to create 3 different Point classes. One for each space. Then have the functions dealing with each space, and transformations between them, all require the appropriate type.

If this were me writing by hand in Java, the sheer offensive stupidity and verbosity of such an approach would prevent me doing any such thing. But with the AI doing the grunt work, it's easy to ask for. And once done, keeps the AI in check. The types prevent it getting confused. While the verbosity doesn't slow it down. (As it would a human.)

Going forward I feel I'm likely to use far more, and more fine grained types when coding with AI than I would without.

All of this does accord to my broader thinking. That AI will soon take over most programming work, but wrapping it in formal constraints will be what makes it reliable enough to use.

Programmers aren't going away. Programming as we know it, will.

We'll all use the AI tools. And we'll all become much more focused on understanding and working with representations of the higher level, more abstract invariants and constraints of the software we are building.

Transcluded from ProgrammersVsAI

A slightly comical tweet stream I wrote here https://mobile.twitter.com/interstar/status/1581981000711966722

You see THIS is why you should never write documentation.

Artists are fucked by AI because there's a huge meta-database mapping text descriptions to pictures.

But programmers are smart. We've resisted the siren calls of documentation and LiterateProgramming ...so there's a relatively impoverished database of plain text descriptions to viable code out there. And jobs are safe.

GithubCopilot is clever, but it's still writing unnecessary snippets of boilerplate that should have been abstracted away from decades ago.

There's no reason AI couldn't learn to translate English descriptions to full applications. Except we don't have good English descriptions of the codebases we have.

And I don't see that situation changing soon.

Boy was I wrong about this. In 2023 and beyond I use ChatGPT (and now CursorEditor) to help me program all the time.