I Wrote the Conversation Before I Wrote the Code, and It Saved Me a Rewrite
Last year I built a small chat feature for a side project. I started the way most of us do: pick a library, drop a chat bubble on the page, wire up some responses, and figure out the βconversationβ part later. Later nev
Last year I built a small chat feature for a side project. I started the way most of us do: pick a library, drop a chat bubble on the page, wire up some responses, and figure out the βconversationβ part later.
Later never went well. The UI worked fine, but the conversations felt awkward. Users asked things I hadnβt planned for, my replies were either too long or too vague, and I had no idea how to handle someone who just typed βhelp.β
So I scrapped it and did it the other way round. I wrote the conversations first, on paper, before touching any code. Hereβs what I learned.
- Write three real dialogues first
Not flow charts, just dialogues. Pick a user, pick their goal, and write both sides like a script. It sounds silly, but youβll find gaps within five minutes. Things like βwait, what does the bot say if they donβt know their order number?β
- Plan the βI donβt get itβ moment
Every conversational interface fails sometimes. What matters is how it fails. A good fallback does three things: admits it didnβt understand, offers two or three concrete options, and gives a way to reach a human. A bad one just repeats βSorry, I didnβt get thatβ in a loop.
- Keep replies short enough to read on a phone
If a reply needs scrolling, itβs probably a help article pretending to be a message. I try to keep each message to a couple of sentences and put the long stuff behind a link.
- Donβt pretend to be human
People forgive a bot thatβs upfront about being a bot. They donβt forgive one that pretends and then gets caught. A friendly tone is great, fake personality isnβt.
- Test with someone who didnβt build it
I asked a friend to try it with no instructions. Within two minutes they typed something Iβd never considered. That one test found more problems than a week of my own clicking around.
What Iβd do differently
Iβd start even smaller. One conversation, one goal, shipped and tested, before adding a second. I also wish Iβd logged the messages people sent that I couldnβt handle, since that list turned into my to-do list.
If youβre curious about conversation-focused projects, Iβve been following what the team at Talkative Labs is working on. Itβs a good place to see how others think about this space.
Whatβs the weirdest thing a user has typed into something you built? Iβd love to hear it in the comments.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.