Speeding up writing with ChatGPT
/I’m painfully aware of the fact that AI has the potential for huge problems on lots of levels. But I don’t think ignoring it is a viable solution. Today I was writing a section of the red phone article (coming to a magazine soon). It was a bit about how JavaScript async and await works. I’d come up with some text and I said this to ChatGPT:
“Would this be a good explanation of async and await: imagine that you could create new versions of yourself at will. If you need to queue to buy something you just create a new version of yourself, put that in the queue and then go about your business. At some point the “new you” will reach the head of the queue, get what you want and then call you and say it has finished before vanishing in a puff of smoke. That’s how awaits and promises work. “
I got this response:
Your analogy is creative and can be a fun way to explain how await and promises work, especially to someone with a vivid imagination. It captures the essence of asynchronous operations, concurrency, and non-blocking behavior, but it might be a bit metaphorical for some audiences who prefer more technical or straightforward explanations.
Here's a breakdown of your analogy:
Creating new versions of yourself represents spawning asynchronous tasks.
Putting a new version in the queue and going about your business relates to the non-blocking nature of asynchronous tasks.
The "new you" reaching the head of the queue and getting what you want symbolizes the completion of an asynchronous operation.
The call and the puff of smoke represent the resolution of a promise and the continuation of your code.
While this analogy can be engaging and illustrative, it's essential to gauge your audience and their familiarity with programming concepts. Some may find it relatable and memorable, while others might prefer a more technical explanation. In many cases, using both a metaphor and a technical explanation can be a helpful way to cater to different learning styles and levels of understanding.
I think this was generally useful critique. It turns out that you ChatGPT doesn’t just answer questions, it can also make sure your text makes sense. Although I can’t help wondering what it would have said if it didn’t like what I’d written.