I spent a couple of days putting together a JSON text editor in a modal dialog for a project I’m working on. I’m combining the Ace editor with the Bootstrap toolkit. I’ve used both components before, but never together. And they’re always a bit tricky to get working because I’m impatient and the docs are spread out, and there are different versions. It’s all kind of a mess, so you just get it working and move on, never quite sure why it works, and I rarely end up with reusable code. But it’s certainly a lot better than starting from scratch, which basically is impossible, given the depth of the two components. After spinning my wheels a bit, I did what I always do in 2024, I turned to ChatGPT, outlined the problem, and asked if it knew of any sample code, which it proceeded to write for me, in about two seconds (not kidding about that). I copied their code and pasted it into my editor and ran it. It worked. Then I went through a number of iterations, restructuring the code to meet my needs, each time checking with ChatGPT, asking what it thought of my code. And of course there were problems, for example at one point there were two vertical scrollbars, and each time we worked together to figure out the problem and the fix. In the end, I have a solid editor that works exactly as I want it to, and best of all, I understand how it works. Here’s the transcript of the work I did with it, over more than 24 hours, a few different sessions. #
28 Jan