
AI Without Context Is a Nightmare
Do you oftentimes work on someone else's code and immediately realized it's AI generated? Unnecessary amounts of useEffects, painfully obvious comments, and worst of all, a long and overkilled process on some functions.
Renato Dulog
May 25, 2025
The contents of this blog are purely based on personal opinions. Any similarities to existing contents are of pure coincidence. Any materials used for the blog belongs to their rightful owners.
I completely admit I am relying on AI to do a lot of things for me every day on my career and my side projects in programming. However, there are sides of it to which I don't like and it's exactly what the title says.
AI Without Context
I've seen a lot of codebases brimming with code prompted from AI, and it's already come to a part where I am actually comfortable having them in it. Still, we can't avoid having to encounter something straight out of a horror movie on some cases, so here are things I've seen so far.
Project Of Wonders
It's that project where every file is another world, where everything is just a novelty, equipped with its own ecosystem and only connected by a single line of "export". Debugging is a raid boss, and somehow all your gears of knowledge become irrelevant.
Functional Disorder
Yep, prompted like a psycho, a project where everything is unnecessarily a function, in fact, it's not even semantic since each part is rendered by a separate function. You'd have dig deep to see the actual structure.
File Conversation
It's that code where it literally talks to you. Too many unnecessary comments which takes up almost 50% of the lines on the actual code. It doesn't really help; in fact, it just makes you more confused as to what it actually means, since most of the time even the comment is hard to understand.
Process Overdrive
These are block of codes that simply blows your mind, what should take 10-20 lines of code is now being presented to you in a 100 line with 3 different async functions and to God knows where the fetch API goes or what it actually gets. It's really amazing to see how far and advanced the function goes for something actually simple.
NPM LIBRARY (LITERALLY)
These are those projects that has a package json importing NPM itself, probably due to the infinite amount of prompt, it has now every single thing you can think of as well as the "is-even" and "is-odd" package. It's just so fascinating to see this at least once in your life.
I'm not mocking people's work, believe me. But sometimes when you encounter these things and have to deal with it, you would actually sit down and think about your life choices. It's just really hard for most of us that actually want full control of the project in order for things to actually be in order.
That is why...
AI Should Have Context
I am simply baffled by the act of prompting "this doesn't work", "fix this", "this is not it" on AI. We should keep in mind that AI does not understand your thought process, without context, it's nothing but a pile of data. Here are some things you can actually do to improve the output quality:
- Pre-submit context files or code, these are the files related to the problem but not the actual problem.
- Add constraints, simply tell it not to do something specific like using a certain NPM package or specifically telling to use an already defined function in your code.
- State the problem, a big plus if you can actually tell it the cause of the problem and what you need as an output.
- Well written prompt, yep, I hate to say it but it's true, you need to actually explain it everything.
- READ THE CODE OUTPUT, for god's sake don't just copy paste it and see if it works, if you already know it wouldn't work and doesn't need to be tested, that would be much better than wasting your time.
- Work your way through each prompt, don't expect the problem to be solved on a single prompt.
You may think that prompting in this manner would take a lot more time, and you're right. But on the flip side, you would actually start at something, and not take a dozen times of prompt before you get what you want.