{"slug": "stop-treating-llms-like-search-engines", "title": "Stop treating LLMs like search engines", "summary": "A developer argues that treating large language models like search engines leads to buggy code, advocating for 'Constraint First Prompting' and a three-step workflow to improve AI-generated code quality. The developer warns that tools like Copilot and Cursor can create a dangerous feedback loop, reducing a programmer's ability to debug their own code.", "body_md": "I spent the first six months of the AI boom treating ChatGPT and Claude like a better version of Google. I would type in a problem, get a snippet of code, paste it into my IDE, and then spend twenty minutes debugging why it didn't actually work in my specific environment.\n\nMost developers do this. We treat the prompt as a search query. But LLMs are not databases of facts. They are pattern matchers. When you ask a search engine for a solution, it finds a page where someone already solved it. When you ask an LLM, it predicts the most likely next token based on a massive pile of training data.\n\nIf your prompt is vague, the model fills the gaps with the most generic patterns it knows. That is why you get boilerplate code that looks correct but fails on the edge cases of your actual project.\n\nThe biggest reason AI generates buggy code is the context gap. The model does not know your project structure, your specific version of a library, or your internal naming conventions.\n\nInstead of asking \"How do I implement a file upload in Node.js?\", which will give you a generic example using a library you might not even use, you need to provide the constraints.\n\nI started using a pattern I call \"Constraint First Prompting\". I define the boundaries before I ask for the logic.\n\nFor example:\n\nWhen you give the model a box to work inside, it stops guessing.\n\nYou have probably heard of Chain of Thought (CoT) prompting, where you tell the AI to \"think step by step\". While that helps the model, it is even more useful when you force yourself to define the steps first.\n\nWhen I have a complex feature, I no longer ask the AI to \"write the function\". I ask it to \"outline the logic for the function in pseudocode\".\n\nOnce the AI gives me the logical steps, I review them. If step 3 is wrong, I correct it there. It is ten times faster to fix a line of pseudocode than it is to debug 50 lines of generated TypeScript. Once the logic is locked in, I tell it: \"Now implement this exact logic in code.\"\n\nCopilot and Cursor are incredible, but they create a dangerous feedback loop. You start a line, it suggests the next three, and you hit Tab. You do this for ten minutes, and suddenly you have a working function.\n\nThen you realize you don't actually know how it works.\n\nI found that my ability to debug dropped because I was no longer the primary author of my code. I was an editor. The problem is that editing is a lower-cognitive effort than writing, and it makes you lazy.\n\nTo fight this, I started a rule: if the AI generates a block of code longer than five lines, I must be able to explain exactly what every line does before I commit it. If I can't, I ask the AI to explain that specific part, or I rewrite it manually.\n\nStop using your prompt box as a search bar. Shift your workflow to this three step process:\n\nThis reduces the amount of \"hallucinated\" boilerplate and ensures the code actually fits into your existing codebase without a total rewrite.", "url": "https://wpnews.pro/news/stop-treating-llms-like-search-engines", "canonical_source": "https://dev.to/ntty/stop-treating-llms-like-search-engines-3m3c", "published_at": "2026-07-27 11:01:10+00:00", "updated_at": "2026-07-27 11:34:24.283701+00:00", "lang": "en", "topics": ["large-language-models", "developer-tools", "ai-tools"], "entities": ["ChatGPT", "Claude", "Copilot", "Cursor"], "alternates": {"html": "https://wpnews.pro/news/stop-treating-llms-like-search-engines", "markdown": "https://wpnews.pro/news/stop-treating-llms-like-search-engines.md", "text": "https://wpnews.pro/news/stop-treating-llms-like-search-engines.txt", "jsonld": "https://wpnews.pro/news/stop-treating-llms-like-search-engines.jsonld"}}