When writing code, I don't let AI do the heavy lifting. Instead, I use it to push back the fog of war on tech I'm trying to master. At the same time, keep the dialogue to a space where I can verify what it's giving me.
- Never ask leading questions. Every token you add to the conversation matters, so phrase your query in a way that forces the AI to connect the dots for you
- Don't ask for deep reasoning and inference. It's not built for this, and it will bullshit/hallucinate if you push it to do so.
- Ask for live hyperlinks so it's easier to fact-check.
- Ask for code samples, algorithms, or snippets to do discrete tasks that you can easily follow.
- Ask for A/B comparisons between one stack you know by heart, and the other you're exploring.
- It will screw this up, eventually. Report hallucinations back to the conversation.
About 20% of the time, it'll suggest things that are entirely plausible and probably should exist, but don't. Some platforms and APIs really do have barn-door-sized holes in them and it's staggering how rapidly AI reports a false positive in these spaces. It's almost as if the whole ML training stratagem assumes a kind of uniformity across the training set, on all axes, that leads to this flavor of hallucination. In any event, it's been helpful to know this is where it's most likely to trip up.
Edit: an example of one such API hole is when I asked ChatGPT for information about doing specific things in Datastar. This is kind of a curveball since there's not a huge amount online about it. It first hallucinated an attribute namespace prefix of data-star- which is incorrect (it uses data- instead). It also dreamed up a JavaScript-callable API parked on a non-existent Datastar. object. Both of those concepts conform strongly to the broader world of browser-extending APIs, would be incredibly useful, and are things you might expect to be there in the first place.